单项选择题
以下选项中,合法的是
A.char str3[] = {'d', 'e', 'b', 'u', 'g', '\0'};
B.char str4; str4 = "hello world";
C.char name[10]; name = "China";
D.char str1[5] = "pass", str2[6]; str2 = str1;
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数)#include#includemain(){ char a[10] = abc , b[10] = 012 , c[10] = xyz ;strcpy(a + 1, b + 2);puts(strcat(a, c + 1));}程序运行后的输出结果是
A.a12xyz
B.12xyz
C.a2yz
D.bc2yz
点击查看答案
单项选择题
有以下程序#include main(){ int a[] = {10, 20, 30, 40}, *p = a, i;for(i = 0; i <= 3; i++){ a[i] = *p; p++;}printf( %d n , a[2]);}程序运行后输出结果是
A.30
B.40
C.10
D.20
点击查看答案
相关试题
有以下程序 #include int fun(int n...
以下函数的功能是输出链表结点中的数据,形...
若有定义语句:char str[] = 0 ;...
有以下程序 #include int k = 7;...
以下程序的输出结果是 [12] 。 #in...