转义字符简介
#include
using namespace std;
//转义字符:存在的意义是表示一些不能显示出来的ASCII字符
//常用的转义字符有:\n \ \t
//转义字符都是由两个字符(即两个字母组成)所组成的
//转义字符都是反斜杠 ‘’
int main()
{
//转义字符
//换行符 \n
cout << "hello world\n";
//注:在 C++ 中有 endl 表示换行,但是 C 中没有,所以使用 \n 代表换行
//反斜杠 \\
//目的是单纯的输出一个反斜杠: \
cout << "\\" << endl;
//水平制表符 \t
//在输出的黑框中,有一个对齐的作用
//一个制表符号有 8 个字节。除了 a 所占用的字节外,其他的使用空格代替
cout << "a\thello world\n";
cout << "aa\thello world\n";
cout << "aaa\thello world\n";
cout << "aaaa\thello world\n";
//a hello world 此为输出结果
//aa hello world
//aaa hello world
//aaaa hello world
//为了输出整齐看起来舒服
system("pause");
};