A: char a[10]= "hello";
B: char a[10]*p=a;P="hello";
C: char *a;a="hello";
D: char a[10],*p;p=a="hello";
举一反三
- 以下程序段中能够正确实现p和q中两个字符串互换的是: A: char p[10]="hello", q[10]= "world", *t;strcpy(t,p); strcpy(p,q); strcpy(q,t); B: char p[10]= "hello", q[10]= "world", *t;t=p; p=q; q=t; C: char p[10]= "hello", q[10]= "world", t[10];strcpy(t,p); strcpy(p,q); strcpy(q,t); D: char p[10]= "hello", q[10]= "world", t[10];t=p; p=q; q=t;
- 下面说明不正确的是______。? char a[10]="china";;;|char a[10],*p=a;p="china";|char a[10],*p=a;p="china";|char a[10],*p;p=a="china"
- 以下操作能实现追加写入文件的是 A: echo "hello" > /tmp/test B: echo "hello" >> /tmp/test C: print "hello " >> /tmp/test D: printf "hello " >> /tmp/test
- 以下涉及字符串数组、字符指针的程序片段,没有编译错误的是( )。 A: char line[]; line="============="; B: char* name[10], *str; name = "Hello World"; C: char str1[10],str2[10]= "prog.c"; str1 = str2; D: char name[10],*str = "Hello World";
- 以下涉及字符串数组、字符指针的程序段,不会产生编译错误的是( )。 A: char* str, name[10]; str = "Hello World"; B: char* str, name[10]; name = "Hello World"; C: char str1[10]= "prog.c", str2[10]; str2 = strl; D: char head_line[]; head_line ="=============";
内容
- 0
以下语句不正确的是( )。? char *a;a="test";|char a[6],*p=a;p="test"| char a[6]="test";|char a[6],*p;p=a="test";
- 1
在使用MapReduce程序WordCount进行词频统计时,对于文本行“hello hadoop hello world”,经过WordCount程序的Map函数处理后直接输出的中间结果,应该是下面哪种形式: A: <"hello",1,1>、<"hadoop",1>和<"world",1> B: <"hello",2>、<"hadoop",1>和<"world",1> C: <"hello",<1,1>>、<"hadoop",1>和<"world",1> D: <"hello",1>、<"hello",1>、<"hadoop",1>和<"world",1>
- 2
以下不能正确读入字符串的程序段是( ) A: char *p;scanf("%s", p); B: char str[10], *p=str;scanf("%s", p[1]); C: char str[10], *p;p=str; scanf("%s", p); D: char str[10];scanf("%s", &str)
- 3
下面各语句行中,能正确进行字符串赋值操作的语句是: A: char *s;scanf("%s",s); B: char st[4][5]={"HELLO"}; C: char s[5]={'H', 'E', 'L', 'L', 'O'}; D: char * s;s="HELLO";
- 4
使用( )命令可以将文本内容快速追加到文档中 A: echo "hello" >>index.html B: echo "hello" >index.html C: echo "hello" <<index.html D: echo "hello" <index.html