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

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

若有定义: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 *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); ” 相关考题
考题 以下与库函数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="abcdefgh";p+=3;printf("%d\n",strlen(strcpy(p,"ABCD")));A.8B.12C.4D.7

考题 若有以下说明和语句:sturct st { int n;char *ch;}; struct st a[3]={5, "abc",7, "def",9, "ghk"},*p=a;则值为6的表达式是( )。A)p++-n B)p-n++C)(*p).n++ D)++p-n

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

考题 若有下列说明和语句,则对结构体变量st中成员i的引用方式不正确的是( )。Stmct stu{ int i;int name;}st,*p;p=st;A.st.iB.*p.iC.(*p).iD.p->i

考题 若有下列说明和语句,则对结构体变量st中成员i的引用方式不正确的是( )。Struct stu{inti;intname;}st,*#p;p=St;A.st.iB.*p.iC.(*p).iD.p->i

考题 若有定义: 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 a[]="abcdefgh"; char *p=a; p+=3; printf("%d\n",strlen(strcpy(p,"ABCD")));A.8B.12C.4D.7

考题 若有以下程序段: struct st {int n; int*m: }; int a=2,b=3,c=5; struct st s[3]=({101,a},{102,c},{103,B)}; main() {struct st*p; p=s; } 则以下表达式中值为5的是( )。A.(*p).mB.*(p+1)->mC.*(p++)->nD.(p++)(*m)

考题 若有以下说明和语句: struct st{int n;char*ch;} struct st a[3]={5,"abc"7,"def",9",ghk"),*p=a; 则值为6的表达式是______。A.p++->nB.p->n++C.(*p).n++D.#NAME?

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

考题 若有定义“char, *p2,*p3,*p4,ch;”,则不能正确赋值的程序语句为 ( )A.p1= ch;scanf("%c",p1);B.p2=(char*)malloc(1);scanf("%c",p2);C.p3=getchar( );D.p4= ch;*p4=getchar( );

考题 以下程序的输出结果是【 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);

考题 若定义下列结构体,结构体变量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;

考题 若有以下定义和语句 struct a{ int n,m;}; struct a st[3]={{2,3},{4,5},{6,7}}; struct a*p=st;则以下错误的引用是A.(p++)-n; B.st[0].n; C.(*p).n; D.P=st.m,

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

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

考题 若有下列定义,则对a数组元素地址的正确引用是( )。int a[5],*p=a;A.p+5 B.*a+1 若有下列定义,则对a数组元素地址的正确引用是( )。int a[5],*p=a;A.p+5B.*a+1C.&a+1D.&a[0]

考题 下面程序段的运行结果是()。  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

考题 单选题若有以下程序段struct st{ int n; struct st*next;};struct st a[3] = {5,a[1],7,a[2],9,'\0'}, *p;p = a[0];则以下选项中值为6的表达式是(  )。A p-n++B (*p).nC ++(p-n)D p-n