计算机二级C语言程序设计
VIP题库
有以下程序main(){ char a[7]="a0\0a0\0"; int i,j; i=sizeof(a); j=strlen(a); printf("%d %d\n",i,j);}程序运行后的输出结果是______。
有以下程序#include #include main(){ char a[] = "TEXT", *b = "++", c[3] = "1";printf("%d,%d,", strlen(a), sizeof(a));printf("%d,%d,", strlen(b), sizeof(b));printf("%d,%d,\n", strlen(c), sizeof(c));}程序运行后的输出结果是______。
若有定义:char *x="abcdefghi";,以下选项中正确运用了strcpy函数的是______。
以下程序段中,不能正确赋字符串(编译时系统会提示错误)的是______。
有以下程序#include int fun(char *s){ char *p=s;while( *p++ != ''\0'');return(p-s);}main(){ char *p="01234";printf("%d\n",fun(p));}程序的运行结果是______。
有如下程序#include main(){char *p, old_str[10] = "wind";int password;scanf("%d", &password);p = old_str;while (*p){printf("%c", *p + password);p++;}printf("\n");}程序运行时,从键盘输入2,输出结果是______。
有以下不完整函数int fun(char *p){ char *t=p;while( *t++);return (______);}该函数的功能是:计算p所指字符串占用内存单元的个数,作为函数值返回。return语句下划线处应填入的是______。
以下程序的运行结果是______。#include main(){ char* st[5]={"1.date","a.trivle","2.mounth","b.Game","3.year"}; int i; i=0; while(i0) { printf("%c",st[i][2]); i-=2; } printf("\n");}
若有程序的部分代码#include main(){ int a[3][5]; ...... fun(3,a); ......}其中,fun(3,a);是函数调用语句,那么,正确的函数fun原型定义是______。
若有定义int a[][4]={11,12,13,14,15,16},(*p)[4]=a+1;,则以下正确的叙述是______。
«
1
2
...
43
44
45
46
47
48
49
...
149
150
»