日本马笼宿11月图片:问一个C语言的问题

来源:百度文库 编辑:高考问答 时间:2024/05/08 14:24:01
输出字符串的长度
#include "stdio.h"
main()
{
static char str[]={"happy"};
int i=0;
while(str[i]!='\o')
i++;
printf("%d",i);
}
我那里错了??

while(str[i]!='\o')
不是\o
是\0
运算结果是5

\o 也可以通过编译啊,只不过结果是500