单项选择题
下列各个选项中对字符数组赋字符串的语句中,错误的是( )。
A.char s[10];s="program";
B.char s[]="program";
C.char s[10]="program";
D.char s[10]; strcpy(s,"program");
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
执行下列语句段后,输出字符“*”的个数是( )。 for (int i=50; 1>1;--i) cout<<'*';
A.48
B.49
C.50
D.51
点击查看答案
单项选择题
下列程序的输出结果是( )。 #include <iostream> using namespace std; int main() char a[]= Hello,World ; char *ptr=a; while(*ptr) if(*ptr>='a'&&*ptr<='z') cout<<char(*ptr+'A'-'a'); else cout<<*ptr; ptr++; retur 0;
A.HELLO,WORLD
B.Hello,World
C.hELLO,world
D.hello,world
点击查看答案
相关试题
有如下类声明: class MyClass int i;...
下面程序的运行结果是______。 #in...
语句cout<<setiosflags(ios::showpos...
-A00,A,B
头文件______中包含了处理用户控制的...