C++ Tutorial/Development/Escape sequence — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
|
(нет различий)
|
Версия 17:21, 25 мая 2010
Содержание
Escape keys for double back slash
<source lang="cpp">#include <iostream> using namespace std; int main() {
cout << "are quite \"useful \" \a \\ in your code \\ \a \n"; return 0;
}</source>
are quite "useful " \ in your code \
Escape sequences: \b
<source lang="cpp">#include <iostream> using namespace std;
int main() {
cout << "123\b\b45"; return 0;
}</source>
145"
Escape sequences: \t
<source lang="cpp">#include <iostream> using namespace std;
int main() {
cout << "one\ttwo\tthree\n"; return 0;
}</source>
one two three
Use the \n code to generate a new line.
<source lang="cpp">#include <iostream> using namespace std;
int main() {
cout << "one\n"; cout << "two\n"; cout << "three"; cout << "four"; return 0;
}</source>
one two threefour"