网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下列语句错误的是( )。

A.char*p="John";p[2]='a';

B.char name[5]="John";name[2]='a'

C.char name[5]="John",*p=name;p[2]='a';

D.char name[5]="John",*p=&name[2];*p='a';


参考答案

更多 “ 下列语句错误的是( )。A.char*p="John";p[2]='a';B.char name[5]="John";name[2]='a'C.char name[5]="John",*p=name;p[2]='a';D.char name[5]="John",*p=name[2];*p='a'; ” 相关考题
考题 根据下列定义,能打印出字母P的语句是( )。struct stu{char name[10];int age;};struct stu s[10]={"John",11,"Pau1",12,"Mary",11,"adam",12};A.primf("%c",s[3].name};B.primf("%c",s[3].name[1]);C.printf("%c",s[2].name[1]);D.printf("%c",s[1].name[0]);

考题 根据下列的定义,能打印出字母P的语句是( )struct stu {char name[10];int age;};stmct stu s[10]={"John",11,"Paul",12,"Mary",11,"adam",12}:A.printf("%c",s[3].name);B.printf("%c",s[3].name[1]);C.printf("%c",s[2].name[11]);D.printf("%c",s[1].name[0]);

考题 根据下列的定义,能打印出字母P的语句是( )。 struct stu { char name[10]; iht age; }; struct stu s[10]={"John",11, "Paul", 12, "Mary", 11, "adam",12 };A.printf("%c",s[3].name);B.printf("%c",s[3].name[1]);C.printf("%c",s[2].name[1]);D.printf("%c",s[1].name[0]);

考题 下列语句错误的是( )。A.char*p="John";P[2]='a';B.char name[5]="John";name[2]='a'C.char name[5]="John",*p=name;p[2]='a';D.char name[5]="John",*p=name[2];*p='a';

考题 根据下列的定义,能打印出字母P的语句是( )。 struct stu {char name[10]; int age; }; struct sm s[10]={"John",11, "Pau1",12, "Mary",11, "adam",12 };A.printf("%c",s[3].name);B.printf("%c",s[3].name[1]);C.printf("%c",s[2].name[1]);D.printf("%c",s[1].name[0]);

考题 根据下面的定义,能打印出字母P的语句是() struct person { char name[9]; int age;}; struct person classes[10]={"John",17, "Paul",19,"Mary",18, "Adam",16};A.printf("%cn",classes[2].name);B.printf("%cn",classes[2].name[1]);C.printf("%cn",classes[1].name[0]);D.printf("%cn",classes[1].name[1]);

考题 根据下面的定义,能打印出字母 M 的语句是 struct person {char name[9]; int age; }; struct person class[10]={"John",17,"Paul",19, "Mary",18, "adam",16};A.printf("%cn",class[3].name);B.printf("%cn",class[3].name[1]);C.printf("%cn",class[2].name[1]);D.printf("%cn",class[2].name[0]);

考题 根据下面的定义,能输出Mary的语句是() struct person { char name[9]; int age; }; struct person class[5]={"John",17,"Paul",19,"Mary",18,"Adam",16};A.printf("%sn" ,class[1].name);B.printf("%sn" ,class[2].name);C.printf("%sn" ,class[3].name);D.printf("%sn" ,class[0].name);

考题 根据以下定义,不能输出字母M的语句是(). struct person {char name[9]; int age; }; struct person class[4]={{"John",17},{"Paul",19},{"Mary",18},{"Adam",16}};A.printf("%cn",class[2].name);B.printf("%cn",*class[2].name);C.printf("%cn",class[2].name[0]);D.printf("%cn",class[2].name[0]++);