转义字符的一段测试

来源:互联网 发布:java编写的游戏引擎 编辑:程序博客网 时间:2024/06/07 23:49
#include<stdio.h>#include<string.h>/*实验转义字符在字符串中*/void test(){char str[]="123\t5\0123\0abc";printf("%ld\n",sizeof(str));//12 :   1 2 3 \t 5 \012 3 \0  a b c \0printf("%ld\n",strlen(str));//7  不包括\0char ch='\n';printf("%s  ch=%d\n",str,ch);//10}int main(){test();char a='\0';printf("\n char:%c\n",a);//nothingreturn 0;}

0 0