int main() { std::string A; A += (std::string)65; std::cout << A; } The code above does not work. It throws a compiler error. But the code below works.
int main() { std::string A; A += (std::string){65}; std::cout << A; } When I wrap the 65 in curly braces, it is interpreted as an ASCII A like I wanted it to be, but without the curly braces, the program doesn't work. I also tried putting multiple numbers in the braces, like so:
int main() { std::string A; A += (std::string){65, 66}; std::cout << A; } That would print out AB. I just hope someone can clear this up for me.