以下程序段运行后*(p+3)的值为() char a[]=”good”; char *p; p=a;
第1题:
下面程序段的运行结果是
char str[]="ABC",*p=str;
printf("%d\n",*(p+3));
A.67
B.0
C.字符′C′的地址
D.字符′C′
第2题:
以下程序运行后的输出结果是【 】
include <stdio.h>
main ( )
{ char a[] ="123456789", *p;
int i =0;
p=a;
while( * p)
{ if(i%2 ==0) *p='*';
p++;i++;
}
puts(a);
}
第3题:
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++
}
第4题:
有以下程序 #include<string.h> #include<iostream.h> void main( ) { char*p="abcde\0fghjik\0"; cout<<strlen(p);} 程序运行后的输出结果是
A.12
B.15
C.6
D.5
第5题:
设有下列程序段: char str[]="HelloWorld": char* plr; ptr=str: 执行上面的程序段后,*(ptr+10)的值为( )。
A. \0
B.0
C.不确定的值
D.0的地址
第6题:
下面程序段的运行结果是( )。 #include<stdio.h> void main() {char str[]="ABC",*p=str; pfintf("%d\n",*(p+3)); }
A.67
B.0
C.字符'C'的地址
D.字符'C'
第7题:
A."ABCD"
B.'D'
C.'\0'
D.不确定
第8题:
下列程序段的输出结果为( )。 #include<stdio.h> main() { static char a[]="language"; char*p; p=a; for(p=a;p<a+8;p+=2) putchar(*p); }
A.1
B.4
C.9
D.0
第9题:
以下程序运行后的输出结果是 。
include
includc
include
main()
{char*p;int i;
P=(char*)malloc(sizeof(char)*20):
strcpy(p.“welcome”):
for(i=6;i>=0;i一一) putchar(*(p+i));
printf(“\n”);free(P);
第10题:
有以下程序: #include <stdio.h>void funl (char * p){ char * q; q=p; while( *q! ='\0') } (*q) ++;q++;}mains( ){ char a[ ] = { "Program" } , * p; p = &a[3]; fun1 (p); printf("% s \n" ,a);}程序执行后的输出结果是( )。
A.Prohsbn
B.Prphsbn
C.Progsbn
D.Program