单项选择题

以下不能将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数组中都没有字符串结束符,故长度都不能确定
相关试题
  • 以下程序的输出结果是______。 #in...
  • 有以下程序: #include <stdio.h> i...
  • 下列程序的运行结果为______。 #in...
  • 以下程序的输出结果是______。 #in...
  • 以下程序的功能是:借助指针变量找出数组元...