Printing ASCII char 0 in a console window

Started by
5 comments, last by Enigma 19 years, 3 months ago
As anyone who has been programming since the age of DOS is probably aware, ascii char 0 (nul) is actually a happy face. Does anyone know how to print it in a modern windows xp console program? I think all my programs would be better with more happy faces.

Shedletsky's Bits: A Blog | ROBLOX | Twitter
Time held me green and dying
Though I sang in my chains like the sea...

Advertisement
char c = 0;cout << c;

?
Well i dont know if the above will work or not but do remember there is a extended ascii keyboard map press alt+RANDOM_KEYPAD_NUMBERS
theres a ascii chart just google ascii chart from there im sure u'd get it
i thought ASCII 001 was a happy face (and 002 was a colored-in (inverted) happy face)... are you sure you aren't off by one?
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
yeah. character zero is the null terminator, or /0.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
Yes, thats correct:
cout<<(char)1;
cout<<(char)2;
Quote:Original post by PnP Bios
yeah. character zero is the null terminator, or /0.


For the common c-style string character zero is a null terminator, but for C++ std::strings character zero is just as valid as any others. On my current platform it prints to the console as a space.

Enigma

This topic is closed to new replies.

Advertisement