若有定义char s1[ ]= “HELLO”, s2[8] = “HELLO1”,s3[80],*s4=s2; 则错误的是
A: strcpy(“s1”, “HELLO”);
B: strcat(s2, “hello2”);
C: strcpy(s3, “hello3”);
D: strcpy(s4, “hello4”);
A: strcpy(“s1”, “HELLO”);
B: strcat(s2, “hello2”);
C: strcpy(s3, “hello3”);
D: strcpy(s4, “hello4”);
举一反三
- char s1[ ] = "hello ";char s2[ ] = "tangx ";strcpy(s1, s2);printf("%s\n", s1);以上代码段执行结果为哪个选项? A: hello tangx B: tangx hello C: hello D: tangx
- 中国大学MOOC: 若有定义char s1[ ]= “HELLO”, s2[8] = “HELLO1”,s3[80],*s4=s2; 则错误的是
- s=”hello”,t=”world”,s+=t,则s为________________,s[-1]为________,s[2:5]为_____________,s[::3]为____________,s[-2::-1]为____________________
- 以下要输出“hello,world!”正确的是? A: String s=String.format("%1s%2s","hello","world");System.out.println(s); B: String s=String.format("%1$s,%2$s","hello","world");System.out.println(s); C: String s=String.format("%s,%s","hello","world");System.out.println(s); D: String s=String.format("%1s,%2s","hello","world");System.out.println(s);
- char s[80],*sp="HELLO!";sp=strcpy(s,sp);s[0]='h';puts(sp);运行结果:________