单项选择题

下列语句组中,正确的是()。

A.char*s;s="Olympic";
B.char s[7];s="Olympic";
C.char*s;s="Olympic";
D.char s[7];s=("Olympic");

<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序 #include<stdio.h> main() char s[]= 012xy 08s34f4w2 ; int i,n=0; for(i=0,s[i]!=0;i++) if(s[i]>= 0 &&s[i]<=’9’)n++; printf( %d n ,n); 程序运行后的输出结果是______。
A.3
B.0
C.7
D.8
单项选择题
以下叙述中正确的是______。
A.对于字符串常量"string!",系统已自动在最后加入了’\0’字符,表示串结尾
B.语句char str[10]="string!";和char str[10]="string!";并不等价
C.对于一维字符数组,不能使用字符串常量来赋初值
D.在语句char str[]="string!";中,数组str的大小等于字符串的长度
相关试题
  • 有以下程序 #include<stdio.h> #inc...
  • 若有定义语句: char s[10]= 12...
  • 若有定义语句: char*s1= OK ,*s2...
  • 若有以下定义和语句 #include<stdio.h...
  • 有以下程序 #include<stdio.h> char...