C语言转义字符\t\r\b\n的含义

来源:互联网 发布:新楼盘查询软件 编辑:程序博客网 时间:2024/06/05 04:07

基本含义:
\t 水平制表
\r 回车
\b 退格
\n 换行


程序代码示例:

#include<stdio.h>#include<stdlib.h>int main(int argc, char* argv[]){    printf("ab c");        //输出:ab c    printf("\t");          //输出:ab c        printf("333312345e\r");//输出:ab c    d333312345e    printf("12345");       //输出:f       g123452345e    printf("jk\n");       //输出:f       g123jk2345e    system("pause");    return 0;}

最终输出:

f       g123jk2345e请按任意键继续. . .
0 0