标题:求助:strlen函数
只看楼主
xiaohuan
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-6-13
 问题点数:0 回复次数:5 
求助:strlen函数
高手们,求助一下...
char a[7]="a0\0a0\0";int i;
i=strlen(a);
请问i的值是多少?重要的是为什么?是不是遇到\0就表示结束了呢?
谢谢帮助!
搜索更多相关主题的帖子: strlen 函数 char 
2008-06-13 15:53
lingluoz
Rank: 2
来 自:苏州科技学院
等 级:新手上路
威 望:4
帖 子:749
专家分:0
注 册:2008-2-2
得分:0 
是的 c语言把\0作为字符串结束标志

Murphy's Law :
If there are two or more ways to do something, and one of those ways can result in a catastrophe, then someone will do it.
2008-06-13 16:33
lqcheng
Rank: 1
等 级:新手上路
帖 子:52
专家分:0
注 册:2007-8-18
得分:0 
刚试了下,结果是2
2008-06-13 16:48
lingluoz
Rank: 2
来 自:苏州科技学院
等 级:新手上路
威 望:4
帖 子:749
专家分:0
注 册:2008-2-2
得分:0 
所以c语言碰到unicode就歇菜了

Murphy's Law :
If there are two or more ways to do something, and one of those ways can result in a catastrophe, then someone will do it.
2008-06-13 16:49
漫游者李李西
Rank: 1
等 级:新手上路
帖 子:110
专家分:0
注 册:2007-11-11
得分:0 
\0和\n都是结束符吧?

2008-06-14 16:18
learnerboy
Rank: 2
等 级:论坛游民
帖 子:246
专家分:22
注 册:2007-11-11
得分:0 
那是!
2008-06-14 16:28



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-219003-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.153390 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved