Actually, the printed value depends on how the character values (value of ch) is interpreted as a character. For instance, when using Windows console the following mapping (typically) is used: http://en.wikipedia.org/wiki/Code_page_850[^] EDIT: That table only contains the top half (symbol half) of the story. For the lower part, refer to any ASCII documentation, for instance: http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters[^]