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

题目内容 (请给出正确答案)

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


参考答案

更多 “ 设已有定义: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); ” 相关考题
考题 以下与库函数strcpy(char *p, char *q)功能不相等的程序段是()。 A.strcpy1(char *p, char *q){ while ((*p++=*q++)!='\0')}B.strcpy2( char *p, char *q){ while((*p=*q)!='\0'){p++ q++}}C.strcpy3(char*p, char *q){ while (*p++=*q++)}D.strcpy4(char *p, char *q){ while(*p)*p++=*q++}

考题 以下正确的程序段是 ()。 A.char str[2]; scanf("%s",B. char *p; scanf("%s",p);C. char str[20]; scnaf("%s",D. char str[20],*p=str; scanf("%s",p[2]);

考题 下面程序段的运行结果是char *p="abcdefgh";p+=3;printf("%d\n",strlen(strcpy(p,"ABCD")));A.8B.12C.4D.7

考题 下面说明不正确的是A.char a[10]="china";B.char a[10],*p=a;p="china"C.char *a;a="china";D.char a[10],*p;p=a="china"

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

考题 下面说明不正确的是A.char a[10]="china";B.char a[10],*p=a;p="china"C.char*a;a="china";D.chara[10],*P;P=a="china"

考题 若有定义:char *x="abcdefghi";,以下选项中正确运用了strcpy函数的是______。A.char y[10]; strcpy(y,x[4]);B.char y[10]; strcpy(++y,x[1]);C.char y[10],*s; strcpy(s=y+5,x);D.char y[10],*s; strcpy(s=y+1,x+1);

考题 有以下程序 include main() { char p[20]={'a','b','c','d'},q[]="abc",r[] 有以下程序 #include<string.h> main() { char p[20]={'a','b','c','d'},q[]="abc",r[]="abcde"; strcpy(p+strlen(q),r);strcat(p,q); printf("%d%d\n",sizeof(p),strlen(p)); } 程序运行后的输出结果是A.20 9B.9 9C.20 11D.11 11

考题 下列程序段中,不能正确赋值的是( )。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();

考题 以下程序段中,不能正确赋字符串(编译时系统会提示错误)的是( )。A.char s[10]=="abcdefg";B.char t[]="abcdefg",*s=t;C.char s[10];s="abcdefg";D.char s[10];strcpy(s,"abcdefg");

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

考题 以下程序的输出结果是()。main(){char*a[][5]={“how”,”do”,”you”,”do”,”!”};char**p;inti;p=a;for(i=0;i A.howdoyoudo!B.howC.howdoyoudoD.hdyd

考题 下面程序段的运行结果是( )。 char a[]="abcdefgh"; char *p=a; p+=3; printf("%d\n",strlen(strcpy(p,"ABCD")));A.8B.12C.4D.7

考题 有以下程序:includevoid f(char p[][10],int n){char t[10];int i,j;for(i=0;i 有以下程序: #include<string.h> void f(char p[][10],int n) {char t[10];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0) {strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);} } main() {char p[5][10]={"abc","aabdfg","abbd","dedbe","cd"}; f(p,5); printf("%d\n",strlen(p[0]));} 程序运行后的输出结果是( )。A.2B.4C.6D.3

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

考题 下面程序段的运行结果是char *p="abcdefgh";p+=3;printf("%d\n",strlen(strcpy(P,"ABCD"))); A.8 B.12 C.4 D.7

考题 下面程序的输出结果是 include includevoid main( ) { char p1[10] ,p2 下面程序的输出结果是#include<iostream.h>#include<string.h>void main( ){char p1[10] ,p2[10] ;strcpy(p1,"abc") ;strcpy(p2,"ABC") ;char str[50] ="xyz";strcpy(str+2,strcat(p1,p2) ) ;cout < < str;}A.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC

考题 以下程序的输出结果是【 14 】#include stdio.h#include stdio.h#include stdlib.h#include string.hmain( ){ char *p,*q,*r,p=q=r=(char*)malioc( sizeof(char)*20);strcpy(p,"attaboy,welcome!");printf(”%c%c%c\n”,p[ 11 ], q[ 3 ],r[ 4 ]);free(p);}

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

考题 下面程序的输出结果是includeincludevoid main( ){char p1[10],p2[10]s 下面程序的输出结果是 #include<iostream.h> #include<string.h> void main( ) { char p1[10],p2[10] strcpy(p1,"abc"); strcpy(p2,"ABC"); char str[50]="xyz"; strcpy(str+2,strcat(p1,p2));A.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC

考题 下面说明不正确的是______。A.char a[10]="USA";B.char a[10],*p=a;p=a;p="USA";C.char*a;a="USA";D.char a[10],*p;a=p="USA";

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

考题 下面程序段的运行结果是()。  char *p=“abcdefgh”;  p+=3;  printf(“%d/n”,strlen(strcpy(p,“ABCD”))); A、4B、7C、8D、12

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

考题 以下与库函数strcpy(char*p1,char*p2)功能不相等的程序段是()A、strcpyl(char*p1,char*p2){while((p1++=p2++)!=’/0’);}B、strcpy2(char*pl,char*p2){while((*p1=*p2)!=’/0’)pl++,p2++;}C、strcpy3(char*pl,char*p2){while((*p1++=*p2++);)D、strcpy4(char*p1,char*p2){whi1e(*p2)*pl++=*p2++;}

考题 单选题有以下程序:#include #include #include main(){ char*p1,*p2; p1=p2=(char*)malloc(sizeof(char)*10); strcpy(p1,malloc); strcpy(p2,p1+1); printf(%c%c, p1[0], p2[0]);}程序的运行结果是(  )。A aaB maC amD mm

考题 单选题下面程序段的运行结果是()。  char *p=“abcdefgh”;  p+=3;  printf(“%d/n”,strlen(strcpy(p,“ABCD”)));A 4B 7C 8D 12