单项选择题

下列能正确定义字符串的语句是( )。

A.char str[]='\64';
B.char str="kx43";
C.char str=";
D.char str[]="\0";
<上一题 目录 下一题>
热门 试题

单项选择题
对下述程序的判断中,正确的是( )。 #include<stdio.h> void main() char *P,s[256]; p=s; while(strcmp(s, the end )) printf( Input the string: ); gets(s); while(*P) putchar(*p++);
A.此程序循环接收字符串并输出,直到接收到字符串“the end”为止
B.此程序循环接收字符串,接收到字符串“the end”则输出,否则程序终止
C.此程序循环接收字符串并输出,直到接收字符串“the end”为止,但因为代码有错误,程序不能正常工作
D.此程序循环接收字符串并将其连接在一起,直到接收字符串“the end”为止,输出连接在一起的字符串
单项选择题
下面程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() char p1[]= WHO ,p2[]= who ,str[50]= xyz ; strcpy(str+1,strcat(p1,p2)); printf( %s ,str);
A.xyzWHOwho
B.zWHOwho
C.zWHOwho
D.xWHOwho
相关试题
  • 下面程序把从终端读入的文本(用@作为文本...
  • 下面程序的功能是:对字符串从小到大进行排...
  • 以下程序用以删除字符串中所有的空格,请填...
  • 若x和n均是int型变量,且x=12,n=5,...
  • 下列程序的输出结果是______。 int...