计算机二级C语言程序设计
VIP题库
以下程序的运行结果是______。#include void fun(char* s);main(){ char st[]="date_"; fun(st+2); printf("\n");}void fun(char* s){ if(*s) { fun(s+1); printf("%c",*s); }}
设有如下定义和语句[1] char *s; s="string";[2] char s[7]; s="string";[3] char s[ ]="string";[4] char s[ ]={''s'',''t'',''r'',''i'',''n'',''g''};其中定义项可以作为字符串使用的是______。
以下选项中,不能正确赋值的是______。
以下使指针指向一个字符串的选项错误的是______。
当执行下面程序且输入:ABC时,输出的结果是______。#include #include main(){ char ss[10]="12345";strcat (ss,"6789");gets(ss);printf("%s\n",ss);}
已定义以下函数fun(char *p2, char *p1){ while((*p2=*p1)!=''\0''){p1++;p2++;} }函数的功能是______。
有以下程序#include #include main(){ char w[20], a[5][10]={"abcdef", "ghijkl", "mnopq", "rstuv", "wxyz."};int i;for (i=0; i
有以下程序#include #include main(){ char x[]="STRING";x[0]=0; x[1]=''\0''; x[2]=''0'';printf("%d %d\n ",sizeof(x),strlen(x));}程序运行后的输出结果是______。
以下涉及字符串数组、字符指针的程序段,没有编译错误的是______。
以下不能将键盘输入的字符串:This is a string读入到str中的程序段是______。
«
1
2
...
41
42
43
44
45
46
47
...
149
150
»