C++/Development/Escape Sequences

Материал из C\C++ эксперт
Перейти к: навигация, поиск

cout: tab, double quote, and new line

#include <iostream>
using namespace std;
int main()
{
   cout << "\nThis is\t a string\n\t\t with \"many\" escape sequences!\n";
   return 0;
}


Demonstrate some escape sequences: \t, tn and \b

#include <iostream> 
using namespace std; 
 
int main() 
{ 
  cout << "one\ttwo\tthree\n"; 
  cout << "123\b\b45"; 
 
  return 0; 
}


Output tab

#include <iostream>
using namespace std;
int main()
{
  cout << "A\tB\tC";
  return 0;
}