对
错
在下面程序运行includeint func(char s[]){ int length=0; while(*(s+length))leng在下面程序运行 #include<iostream.h> int func(char s[]){ int length=0; while(*(s+length))length++; return length; } void main(){ char a[10], *ptr=a; cin>>ptr; cout<<fune(ptr)<<end1; } 如果输入字符串Hello!并回车,则输出结果为 ______。A.4B.7C.6D.5
点击查看答案
获得字符串s长度的方法是什么?A.s.len()B.s.lengthC.len(s)D.length(s)
返回字符串长度的函数是()。A、length()B、left()C、long()D、len()
使用方法length()可以获得字符串的长度。()
当使用setLength(int length)时,如果length的长度小于原字符串的长度,那么进行setLength操作后当前字符串的长度为length,且后面的字符被删除
使用void setLength(int length)设置字符串长度时,如果length大于原字符串长度,那么将会在字符串后面补上()A、字符‘/u0000’B、不做任何操作C、任意字符D、补0
数据结构里,关于字符串描述正确的是()。A、字符串可以为空串B、字符串的长度计算’/0’在内C、字符串比较函数strcmp返回值类型是charD、字符串求长度使用strcat