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

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

若有定义: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

考题 若有以下说明和语句: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);

考题 以下正确的程序段是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 *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);

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

考题 若有下列说明和语句,则对结构体变量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)

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

考题 以下正确的程序段是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);

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

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