单项选择题
以下不能将s所指字符串正确复制到t所指存储空间的是( )。
A.while(*t=*s)t++;s++;
B.for(i=0;t(i]=s[i];i++);
C.do*t++=*s++;)while(*s);
D.for(i=0,j=0;t[i++]=s[j++];);
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序 #include <stdio.h> void fun(char **p) ++p; printf( %s n ,*p); main() char *a[]= Morning , Afternoon , Evening , Night ; fun(a); 程序的运行结果是( )。
A.Afternoon
B.fternoon
C.Morning
D.orning
点击查看答案
单项选择题
有以下程序: #include <string.h> main() char p[]='a','b','c', q[10]='a','b','c'; printf( %d %d n ,strlen(p),strlen(q)); 以下叙述中正确的是( )。
A.在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3
B.由于p数组中没有字符串结束符,长度不能确定;但q数组中字符串长度为3
C.由于q数组中没有字符串结束符,长度不能确定;但p数组中字符串长度为3
D.由于p和q数组中都没有字符串结束符,故长度都不能确定
点击查看答案
相关试题
有以下程序: #include <stdio.h> ...
若程序中有宏定义行:#define N 100...
有以下程序: void main() int num[...
若有以下语句: typedef struct s int...
有以下程序: #include <stdio.h> m...