(pronounced "see-out") is not a Visual C++ command word,
although it acts like one. You will not see cout
in the list of Command Words (or Keywords). cout
is an operator (just as addition or multiplication are
operators) described in the header file iostream.h. cout
sends output to an output device, usually the screen. The
double arrows (<<) point the way (toward "out"),
showing that the information is going "out" to the
The following is a table of escape sequences which
can be used with cout:
||Moves to beginning of next line
||Backs up one character
||Moves to next tab position
||Sounds a beep
||Displays an actual backslash
||Displays an actual single quote
||Displays an actual double quote
||Displays an actual question mark
If you wish to use the ANSI code sheet
to print "fancy" characters on the screen, you can place the
code sheet's octal number after a backslash with a cout
statement. For example,
cout << "\3"
//prints a small heart on the screen.
If you wish to use the ASCII code sheet
to print "fancy" characters on the screen, use the
// prints the Greek letter sigma on the screen.
Tidbits of information about those pesky
||printing in the last column will force a
||the tab spacing is every 8 columns
consistently starting with 1:
(9, 17, 25, 33, 41, 49, 57, 65, 73 . . . then go to 1)
||tabbing beyond one line's "worth" will
push the tabs into the same tabbing pattern on the next
line starting with 1.
||tabbing takes you to the next available
||if you print in the "8th" column and
then tab, tab will skip the next field and take you to
the NEXT tab location.
||tabbing without the use of \n, will
simply continue in the same pattern.
Return to Topic Menu |
Computer Science Main Page |