单项选择题

若有定义:char *st="how are you"; ,下列程序段中正确的是()。

A) char a[11], *p; strcpy(p=a+1, &st[4]);
B) char a[11]; strcpy(++a, st);
C) char a[11]; strcpy(a, st);
D) char a[], *p; strcpy(p=&a[1], st+2);

<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: #include<stdio.h> #define f(x) (x*x) main() int i1, i2; i1=f(8) f(4); i2=f(4+4) f(2+2); printf( %d, %d n , i1, i2); 程序运行后的输出结果是()。

A、 64, 28
B、 4, 4
C、 4, 3
D、 64, 64

单项选择题
有以下程序: #include<stdio.h> #include<string.h> main() char p[]='a', 'b', 'c', q[10]='a', 'b', 'c'; printf( %d%d n , strlen(p), strlen(q) ); 以下叙述中正确的是()。

A、 在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3
B、 由于p数组中没有字符串结束符,长度不能确定,但q数组中字符串长度为3
C、 由于q数组中没有字符串结束符,长度不能确定,但p数组中字符串长度为3
D、由于p和q数组中都没有字符串结束符,故长度都不能确定

相关试题
  • (3)()
  • (2)()
  • 规定输入的字符串中只包含字母和*号。编写...
  • 下列给定程序中,函数fun的功能是:求两个...
  • (1)()