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

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

设已有定义: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)” 相关考题
考题 以下与库函数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++}

考题 若有定义:char*p(chara[10]);则p是函数名。() 此题为判断题(对,错)。

考题 有以下程序#includemain()void f(char p[][10], int n ) /* 字符串从小到大排序 */{ char t[10]; int i,j;for(i=0;ifor(j=i+1;jif(strcmp(p[i],p[j])0) {strcpy(t,p[i]); strcpy(p[i],p[j]); strcpy(p[i],t); }}main(){char p[5][10]={“abc”,”aabdfg”,”abbd”,”dcdbe”,”cd”};f(p,5);printf(“%d\n”,strlen(p[0]));}程序运行后的输出结果是( )。A.2B.4C.6D.3

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

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

考题 下列程序的输出结果是()。includeusing namespace std;int main()于chara[]=”Hello,Te 下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() 于 chara[]=”Hello,Test”; Char*p=a; while(*p) { if(*p)=’a’*p(=’z’) cout<<char(*p+’A’-’a’); else cout<<*p; p++; } return 0; }A.hello,testB.Hello,TestC.HELLO,TESTD.hELLO,tEST

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

考题 下列对变量的引用中,错误的是()。A.int a; int p=a;B.Chara;char p=a;C.int a; int p=a;B.Chara;char p=a;C.int a; int p;p=a;D.float a;float p=a;

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

考题 有以下程序: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);

考题 下面程序的输出结果是 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

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

考题 若有定义:chara[]=abcdef;charb[]=xyz;则以下程序段运行后屏幕输出为()strcpy(a,b);printf(%c,a[2]); A.cB.zC.\0D.d

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

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

考题 若有定义:chara[]="abcdef";charb[]="xyz";则以下程序段运行后屏幕输出为() strcpy(a,b); printf("%c",a[2]);A、cB、zC、/0D、d

考题 若定义chara[80]=”95”,b[]=”windows”;,语句printf(”%s”,strcpy(a,b));的输出结果为()A、windows95B、windowsC、95D、95windows

考题 以下与库函数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++;}

考题 下列字符串赋值语句中,不能正确把字符串“HelloWorld”赋给数组的语句是()A、chara1[]={’H’,’e’,’l’,’l’,’o’,’’,’W’,’o’,’r’,’l’,’d’,’/0’};B、chara2[15];strcpy(a2,"HelloWorld");C、chara3[15];a3="HelloWorld";D、chara4[10]={"HelloWorld"};

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

考题 单选题有以下程序:#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

考题 单选题若有定义:chara[]="abcdef";charb[]="xyz";则以下程序段运行后屏幕输出为() strcpy(a,b); printf("%c",a[2]);A cB zC /0D d

考题 单选题有以下程序: #include #include main() {  inti;  chara[]=Howareyou!;  for(i=0;a[i];i++)  {   if(a[i]=='')   {    strcpy(a,a[i+1]);    i=0;   }  }  printf(%s,a); } 程序的运行结果是(  )。A you!B Howareyou!C areyou!D are you!

考题 单选题有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数): #include #include main() {  chara[10]=abc,b[10]=012,c[10]=xyz;  strcpy(a+1,b+2);  puts(strcat(a,c+1)); } 程序运行后的输出结果是(  )。A a12xyzB 12yzC a2yzD bc2yz