下面程序的运行结果是( )。#includemain(){static char a[ ]=“Language”,b[ ]=”programe”;char *p1, *p2; int k=0;p1=a; p2=b; printf(" %c”,*(p1+k));}
A. gae
B. L
C. Language
D. 有语法错误
查看答案
下面程序运行结果是( )。#include#includemain(){char *s1=”AbDeG”; char *s2=”AbdEg”;s1+=2; s2+=2;printf(“%d\n”,strcmp(sl,s2));}
A. 正数
B. 负数
C. 零
D. 不确定的值
下面的程序的运行结果是( )。#includemain(){char *p,s[ ]=”ABCDEFG”;for(p=s; *p!=’\0’;){printf(“%s\n”,p);p++;if(*p!=’\0’)p++;else break; }}
ABCDEFGABCDEABCA
B. ABCDEFGBCDEFCDED
C. ACEG
D. ABCDEFGBCDEFEFGG
下面程序的运行结果是( )。#include#incudemain(){char* p1,*p2,str[50]=”abc”;p1=”abc”; p2=”abc”;strcpy(str+1,strcat(p1,p2));printf(“%s\n”,str);}
A. abcabcabc
B. bcabcabc
C. aabcabc
D. cabcabc
设有以下程序段:charstr[4][10]={“frist”,”second”,”third”,”forurth”},*strp[4];int n;for(n=0;n<4;n++) strp[n]=str[n];若k为int型变量且0<=k<4,则对字符串的不正确引用是( )。
A. strp
B. str[k]
C. strp[k]
D. *strp