单项选择题

有以下程序: #include <stdio.h> void swap(char *x, char *y) { char t; t=*x; *x=*y; *y=t; } main() { char *s1="abc", *s2="123"; swap(s1, s2); printf("%s, %s\n", s1, s2); } 程序执行后的输出结果是______。

A.321,cba
B.abc,123
C.123,abc
D.1bc,a23
<上一题 目录 下一题>
热门 试题

单项选择题
有以下函数:int fun(char *x, char *y){ int n=0;while((*x==*y)&&*x!=’ 0’){x++; y++; n++;}return n;}函数的功能是( )。
A.将y所指字符串赋给x所指存储空间
B.查找x和y所指字符串中是否有’\0’
C.统计x和y所指字符串中最前面连续相同的字符个数
D.统计x和y所指字符串中相同的字符个数
单项选择题
有以下程序:#include <stdio.h>int fun(){ static int x=1;*x=2;return x;}main(){ int i, s=1;for(i=1; i<=3; i++)s* =fun();printf( %d n , s);}程序运行后的输出结果是______。
A.10
B.30
C.0
D.64
相关试题
  • 以下叙述中正确的是______。
  • 有以下程序:#include <stdio.h>main...
  • 以下叙述中错误的是______。
  • 有以下程序:#include <stdio.h>#inc...
  • 有以下程序:#include <stdio.h>struc...