【单选题】【消耗次数:1】
下面错误的初始化语句是:()。
char str[]=hello;
char str[100]=hello;
char str[]={h,e,l,l,o};
char str[]={hello};
参考答案:
复制
纠错
相关题目
【判断题】 char[] str=abcdefgh;
①  正确
②  错误
【判断题】 String str=abcdefghi;char chr=str.charAt(9);
①  正确
②  错误
【单选题】 已有定义char str1[15]={“computer”} , str2[15] ; 则语句用法正确的是()。
①  str2=str1;
②  str2=science;
③  scanf(%s,str2);
④  printf(%s,str1);
【单选题】 对于以下结构定义:struct{intlen;char*str;}*p;p->str++中的++加在()
①  指针str上
②  指针p上
③  str所指的内容上
④  以上均不是
【简答题】 下面程序的运行时,输入CLanguage↙,输出是[填空1]。#includestdio.hvoid main( ){ char str[30];scanf(%s,str); printf(%s,str);}
【单选题】 下面是对字符数组str 的初始化语句,其中不正确的是()。
①  char str[5]={abcd};
②  char str[5]={’a’,’b’,’c’,’d’};
③  char str[]=abcd;
④  char str[5];str=abcdef;
【单选题】 文本文件quiz.txt的内容为"Programming"(不包含引号),以下程序段的运行结果是()。FILE*fp;char*str;if((fp=fopen("quiz.txt","r"))!=NULL)str=fgets(str,7,fp);printf("%s",str);
①  Progr
②  Progra
③  Program
④  Programming
【单选题】 数组a经初始化 char a[ ]=“English”; a[7]中存放的是( )。
①  A. 字符串的结束符
②  B. 字符h
③  C. 〝h〞
④  D. h
【单选题】 数组a经初始化 char a[ ]=“English”; a[1]中存放的是( )。
①  A. 字符n
②  B. 字符E
③  C. 〝n〞
④  D. 〝E〞
【单选题】 若定义:string str; 当语句cin>>str; 执行时,从键盘输入:Microsoft Visual Studio 0! 所得的结果是str=( )。
①  Microsoft Visual Studio 0!
②  Microsoft
③  Microsoft Visual
④  Microsoft Visual Studio 0
随机题目
【判断题】 Some girls is singing in the classroom now.
①  正确
②  错误
【单选题】 We will go outside if it [填空] tomorrow.
①  don't rain
②  didn't rain
③  doesn't rain
④  isn't rain
【单选题】 Jim was good at [填空] .
①  draw
②  drawing
③  draws
④  drawed
【单选题】 Did you [填空] a party last weekend?
①  had
②  have
③  has
④  having
【单选题】 [填空] play football in the public area.
①  Don't
②  Doesn't
③  Do
④  Does
【单选题】 [填空] one do you prefer?
①  What
②  Which
③  How
④  Whose
【判断题】 Does she do the exercise every day?
①  正确
②  错误
【判断题】 A new bridge has been built on Xinan River.
①  正确
②  错误
【单选题】 There will be [填空] only one person in the exam.
①  a
②  an
③  the
④ 
【单选题】 He spent a lot of money [填空] toys and games.
①  buy
②  buying
③  to buy
④  bought