02 C转义字符

①\t:一个制表位,实现对齐的功能

②\n: 换行符

③\\:一个 \

④\" : 一个 "

⑤\' : 一个 '

⑥ \r : 一个回车 

 1 //1,引入头文件
 2 #include<stdio.h>
 3 
 4 void main() {
 5     printf("北京\t上海\t天津\n");
 6     printf("张三说:\n你好\n");
 7     printf("hello,\\world\n");
 8     printf("hello,\"world\n");
 9     printf("hello,\'world\n");
10     printf("唐伯虎点\r秋香\n");  //注意\r表示回车不是换行,光标返回到行首
11 }

猜你喜欢

转载自www.cnblogs.com/shanlu0000/p/12336186.html
今日推荐