单项选择题

有以下程序:
main()
char str[]="xyz", *ps=str;
while(*ps) ps++;
for(ps--;ps-str>=O;ps--)
puts(ps);
执行后的输出结果是( )。

A.yz
xyz
B.z
yz
C.z
yz
xyz
D.x
xy
xyz
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: main() int a=7,b=8,*p,*q,*r; p=&a; q=&b; r=p; p=q; q=r; printf( %d,%d,%d,%d n ,*p,*q,a,b); 程序运行后的输出结果是( )。
A.8,7,8,7
B.7,8,7,8
C.8,7,7,8
D.7,8,8,7
单项选择题
以下程序段中,能够通过调用函数fun(),使main()函数中的指针变量p指向一个合法的整型单元的是( )。
A.main()
int*p;
fun(p);
…

int fun(int*p)
int s; p=&s;
B.main
int*p
fun(&p);
…

iht fun(int**p)
int s; *p=&s;
C.main()
int*p;
fun(&p);

int fun(int**p)
*p=(int*)malloc(2);
D.main()
int*p;
fun(p);

int fun(int*p)
p=(int*)malloc(sizeo(int));
相关试题
  • 若有以下程序: main() char a; a=...
  • 下面程序的功能是调用sub函数计算数组a中字...
  • 以下程序的输出结果是 【13】 。 #in...
  • 下面程序的功能是将一个字符串str的内容颠...
  • 以下程序的运行结果是 【10】 。 #de...