网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
设已有定义:char*st=”howareyou”;下列程序段中正确的是()。
A

chara[11],*p;strcpy(p=a+1,st[4]);

B

chara[11];strcpy(++a,st);

C

chara[11];strcpy(a,st);

D

chara[],*p;strcpy(p=&a[1],st+2)


参考答案

参考解析
解析: 暂无解析
更多 “单选题设已有定义:char*st=”howareyou”;下列程序段中正确的是()。A chara[11],*p;strcpy(p=a+1,st[4]);B chara[11];strcpy(++a,st);C chara[11];strcpy(a,st);D chara[],*p;strcpy(p=a[1],st+2)” 相关考题
考题 若有定义: char *st= "how are you "; ,下列程序段中正确的是A.char a[11], *p; strcpy(p=a+1, ,下列程序段中正确的是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);

考题 下列程序段中的变量已正确定义: for(i=0;i 下列程序段中的变量已正确定义: for(i=0;iA.********B.****C.**D.*

考题 以下正确的程序段是A.char str1[ ]="12345", str2[ ]="abcdef";B.char str[10],*st="abcde";strcat(str,st);C.char str[10]=" "。*st="abcde";strcat(str,st);D.char *st1="12345", *st2="abcde";strcat(st1, st2);

考题 设已包含头文件,下列程序段的运行结果是()。char s1[]={"ACDEF"};char s2[]="ABC";strc 设已包含头文件<string.h>,下列程序段的运行结果是( )。 char s1[]={"ACDEF"}; char s2[]="ABC"; strcpy(s1,s2); printf("%d",strlen(s1));A.3B.4C.6D.5

考题 下列程序段中,不能正确赋值的是( )。A.char*p,ch; p=Ch; scanf("%c",p);B.char*p; p=char*)malloc(1); scanf("%c",p);C.char*p; *p=getchar();D.char*p,ch; p=ch; *p=getchar();

考题 设已执行预编译命令include,以下程序段的输出结果是char s[]="an apple";printf("%d\ 设已执行预编译命令#include<string.h>,以下程序段的输出结果是 char s[]=" an apple" ; printf("%d\n",strlen(s));A.7B.8C.9D.10

考题 下列程序段的输出结果为()。includemain(){static char a[]="language";char*p;p=a;for 下列程序段的输出结果为( )。 #include<stdio.h> main() { static char a[]="language"; char*p; p=a; for(p=a;p<a+8;p+=2) putchar(*p); }A.1B.4C.9D.0

考题 设函数f的原型是:char *f (const char*);,pf 是指向f 的指针,则pf 的定义是【 】。

考题 若有定义: 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);

考题 下面的程序执行后,文件test.t中内容是______。 inc1udevoid fun(char*fname,char*st) { 下面的程序执行后,文件test.t中内容是______。 #inc1ude<stdio.h> void fun(char*fname,char*st) { FILE*myf;int i; myf=fopen(fname,"w") for(i=0;i<strlen(st);i++)fputc(st[i]myf); fdose(myf); } main() { fun("test.t""new word");fun("test.t,"hello,");}A.hello,B.new wor1dhelloC.new worldD.hello,rld

考题 下面的程序执行后,文件test.txt中的内容是______。 include void fun(char *fname,char 下面的程序执行后,文件test.txt中的内容是______。 #include<stdio.h> void fun(char *fname,char *st) { FILE*myf;int i; myf=fopen("test.txt","w"); for(i=0;i<strlen(st);i++) fputc(st[i],myf); fclose(myf); } main() { fun("test","new one"); fun("test","hello,"); }A.hello,B.new onehello,C.new oneD.hello,ne

考题 若有定义:char*st="how are you";,下列程序段中正确的是A.chara[11],*p;strcpy(p=a+1,st[4]);B.chara[11];strcpy(++a,st);C.chara[11];strcpy(a,st);D.chara[],*p;strcpy(p=a[1],st+2);

考题 有以下程序段#include stdio.hvoid fun(char*fname,char*st){ FILE * myf; int i; myf=fopen(fname,"w"); for(i=0;istrlen(st);i++)fputc(st[i],myf); fclose(myf);}main(){ fun("test.t","new world"); fun("test.t","hello,");}程序执行后,文件test.t中的内容是A.hello, B.new worldhello,C.new world D.hello,rld

考题 设有以下定义: 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;srtcpy(p=a[1],st+2);

考题 若定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。 struct st { int x; int y; int z; } struct worker { char name[20]; char sex; struct st birth; }p;A.x=1987B.birth.x=1987;C.p.birth.x=1987;D.p.x=1987;

考题 设定义下列结构体,结构体变量p的出生年份赋值正确的语句是( )。Struct st{ int x;inty;int z;}Struct worker{ char name[20];char sex;struct st birth;}p;A.x=1987B.birth.x=1987;C.p.birth.x=1987;D.p.x=1987;

考题 以下程序:includemain(){char str[10];scanf("%s",str);printf("%s\n",str);}运 以下程序: #include<stdio.h> main() {char str[10]; scanf("%s",str); printf("%s\n",str); } 运行上面的程序,输入字符串how are you,则程序的执行结果是( )。A.howB.how are youC.hD.howareyou

考题 下面的程序执行后,文件test.t中内容是______。 includevoid fun(char *fname,char *st) 下面的程序执行后,文件test.t中内容是______。 #include<stdio.h> void fun(char *fname,char *st) {FILE *myf; int i; myf=fopen(fname,"w"); for(i=0;i<strlen(st);i++)fputc(st[i],myf); fclose(myf); } main() {fun("test.t","new world");fun("test.t","hello,");}A.hello,B.new worldhelloC.new worldD.hello,rld

考题 若有定义:char*st=”how are you”;,下列程序段中正确的是( )。A. B. C. SX 若有定义:char*st=”how are you”;,下列程序段中正确的是( )。A.B.C.D.

考题 以下程序段中的变量已正确定义: 程序段的输出结果是( )。 A.********B.**** 以下程序段中的变量已正确定义:程序段的输出结果是( )。A.********B.****C.**D.*

考题 以下正确的程序段是A.char str1[]="12345",str2[]="abcdef";B.char str[10],*st="abcde";strcat(str,st);C.charstr[10]=" "。*st="abcde";strcat(str,st);D.char*st1="12345",*st2="abcde";strcat(st1,st2);

考题 下列描述中,不能正确给字符数组str定义和赋值的是( )。 A、char str[]={"abcdefghijklmn "};B、char str[10];str={" abcdefghijklmn "};C、char str[10]={"abcdefghijklmn"};D、char str[10];strcpy(str,"abcdefghijklmn");

考题 设下面程序段中调用fun函数传送实参a和b, main() { chara[10],b[10] ┇ fun(a,b); ┇ } 则在fun函数首部中,对形参错误的定义是( )A.fun(char a[10],b[10]){…}B.fun(char a1[],char a2[]){…}C.fun(char p[10],char q[10]){…}D.fun(char*s1,char*s2){…}

考题 设已有定义: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);

考题 在以下程序段中,已知血型数据占两个字节,则输出结果是 union un { int i; double y; } struct st { char a[10]; union un b; }; printf("%",sizeof(struct st));A.14B.18C.20D.16

考题 有以下的程序includevoid fun(char*fname,char*st){FILE*myf;inti; myf=fopen(fname," 有以下的程序 #include<stdio.h> void fun(char *fname,char *st) { FILE *myf; int i; myf=fopen(fname,"w"); for(i=0;i<strlen(st);i++)fputc(st[i],myf); fclose(myf); } main() { fun("test.t","new world");fun("test.t","hello,");} 程序执行后,文件test.t中的内容是( )A.hello,B.new worldhello,C.new worldD.hello,rld

考题 设已执行预编译命令include,以下程序段的输出结果是()。char s[]="an apple";printf(" 设已执行预编译命令#include<string.h>,以下程序段的输出结果是( )。 char s[]=" an apple" ; printf(" %d\n" ,strlen(s));A.7B.8C.9D.10

考题 设已有定义:char*st=”howareyou”;下列程序段中正确的是()。A、chara[11],*p;strcpy(p=a+1,st[4]);B、chara[11];strcpy(++a,st);C、chara[11];strcpy(a,st);D、chara[],*p;strcpy(p=a[1],st+2)