How to display special symbols by using C++?

Dec 17, 2013 at 3:28am
I accidentally wrote a program that contains some bugs but it displays some lovely symbols.
The caption of the output is shown in the link below
http://postimg.org/image/604127iip/

I wonder how to make the program output those symbols?
What should I put in the cout << " "?
Dec 17, 2013 at 5:36am
Take a look here.
http://www.asciitable.com/

Your standard char is one byte (8 bits), and can therefore represent a total of 256 different characters.
A unicode/wide character can represent many more characters, but they're no longer one byte as a result.

One way of printing unusual/extended ASCII characters (true for all ascii characters to be realistic), is to cast an integer type to a character.

Example:

1
2
std::cout << (char)201 << (char)187 << std::endl;
std::cout << (char)200 << (char)188 << std::endl;
Last edited on Dec 17, 2013 at 5:39am
Topic archived. No new replies allowed.