View Single Post
Old 01-01-2005, 03:33 PM   #1 (permalink)
slashdot
Registered User
 
Join Date: Dec 2004
Posts: 43
slashdot is on a distinguished road
What does this mean?

In simple words, can you retell me what this part of "sams teach it yourself C++ in 21days"

Special Printing Characters

The C++ compiler recognizes some special characters for formatting. Table 3.2 shows the most common ones. You put these into your code by typing the backslash (called the escape character), followed by the character. Thus, to put a tab character into your code, you would enter a single quotation mark, the slash, the letter t, and then a closing single quotation mark:

char tabCharacter = `\t';

This example declares a char variable (tabCharacter) and initializes it with the character value \t, which is recognized as a tab. The special printing characters are used when printing either to the screen or to a file or other output device.

New Term: An escape character changes the meaning of the character that follows it. For example, normally the character n means the letter n, but when it is preceded by the escape character (\) it means new line.

Table 3.2. The Escape Characters.
Character What it means
\n new line
\t tab
\b backspace
\" double quote
\' single quote
\? question mark
\\ backslash

If you can tell me what exactly it means, plz explain in easier terms, and examples. Thanx.
slashdot is offline   Reply With Quote