1.转义字符
2.代码实践
# include "iostream"
# include "windows.h"
using namespace std;
int main()
{
SetConsoleOutputCP(CP_UTF8);
cout << "你好呀 \n 我喜欢你" << endl;
cout << "-------------" << endl;
// \t制表符演示,效果等于键盘的tab键,一个制表符可以补充到8个字符位
cout << "hello\titheima" << endl;
cout << "a\titheima" << endl;
cout << "-------------" << endl;
//当你需要打印\本身 需要\\,如果要打印双引号和单引号,需要\“ \'来转义,是反向转义,将双引号和单引号的特殊效果消除
cout << "\\" << endl;
cout << "\" \'";
return 0;
}
输出结果