|
Up until now, the only way you've seen to move down a line is by using Well, there is, and it's the magic of escape codes. What's an escape code? Well, they are a bunch of codes you can put in the middle of a string that represent actions. They can produce a tab on the screen, move the cursor down a line, back the cursor up, even make the computer beep. They best part is, you put them right inside your strings, so it saves a little work.
Escape codes always begin with a "
#include <iostream.h>
void main(void)
{
cout << "Hello World!\n";
}
Notice how the "
#include <iostream.h>
void main(void)
{
cout << "Here is a Return (\n) " << endl;
cout << "Here is a Tab (\t) " << endl;
cout << "Here is a Backspace (\b)" << endl;
cout << "Here is a Beep (\a) " << endl;
cout << "Here is a Slash (\\) " << endl;
cout << "Here is a Quote (\") " << endl;
}
The above code should explain itself, but here is a list of escape codes you can use and what they mean: \n Newline \t Tab \b Backspace \a Beep \\ Backslash \? Question Mark \' Single Quote \" Double Quote |