欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

c语言:有趣的转义字符用法

程序员文章站 2022-03-14 08:24:24
  程序1: #include int main() { printf("c:\test\add\72_1...

 

程序1:

#include<stdio.h>
int main()
{
   printf("c:\test\add\72_12\test.c");
  return 0;
}

 

结果:

c:      estdd:_12       est.c

 

 

             Press any key to continue

程序2

#include<stdio.h>
int main()
{
   printf("%d\n",strlen("c:\test\add\72_12\test.c"));
   //\t是水平制表符,\a是警告字符,蜂鸣;都只占一个字节
  return 0;
}

 

结果:

19