以下程序的输出结果是【 】。
include<iostream. h>
void main() {
char *p= "12345678" , *r;
long *q;
q=(long *)p;
q++;
r= (char *) q:
cout<<r;
}
第1题:
以下程序的结果是( )。 #include<iostream.h> void main() {char*p="abcdefgh",*r; long*q; q=(1ong*)P; q++; r=(char*)q; cout<<r<<endl;=
A.defg
B.cdef
C.ghab
D.efgh
第2题:
以下程序的结果是 #include<iostream.h> void main( ) { char * p="abcdefgh",* r; long * q; q=(long * )p; q++; r=(char * )q; cout < < r < < end1;}
A.defg
B.cdef
C.ghab
D.efgh
第3题:
有以下程序: #include<stdlib.h> main( ) { char *p ,* q; p=(char * )malloc(sizeof(char) * 20);q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); } 若从键盘输入:abc def<回车>,则输出结果是
A.def def
B.abc def
C.abc d
D.d d
第4题:
有以下程序: #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20);q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); } 若从键盘输入:abc def<回车>,则输出结果是( )。
A.def def
B.abc def
C.abe d
D.d d
第5题:
有以下程序 #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20); q=p; scanf("%s %s",p,q); printf("%s %s\n",p,q); } 若从键盘输入:abc def<回车>, 则输出结果是
A.def def
B.abc del
C.abc d
D.d d
第6题:
有以下程序 #include<stdlib.h> main() { char*p,*q; p=(char *)malloc(sizeof(char)*20);q=p; scanf(“%s%s”,p,q);printf(“%s%s\n”,p,q); } 若从键盘输入:abc def<回车>,则输出结果是
A.def def
B.abc def
C.abc d
D.d d
第7题:
若有如下程序段:
include <iostream>
using namespace std;
int main()
{
char *p="abcdefgh",*r;
long *q;
q=(long *)p;q++;
r=(char *)q;
cout<<r<<end1;
return 0;
}
该程序的输出结果是______。
第8题:
若有如下程序: #include <iostream> using namespace std; int main() { char *p="abcdefgh",*r; long *q; q=(long *)p; q++; r=(char *)q; cout<<r<<end1; return 0; } 上述程序的输出结果是( )。
A.abcdefgh
B.0
C.abcd
D.efgh
第9题:
若有以下程序段:
include <iostream>
using namespace std;
int main()
{
char*p="abcdefgh",*r;
long*q;
q=(long*)p;q++;
r=(char*)q;
cout<<r<<end1;
return 0;
}
该程序的输出结果是【 】。