问题
单项选择题
以下程序的输出结果是______。 #include<stdio.h> #include<siring.h> fun(char *w,int n) { char t,*s1,*s2; s1=w;s2=w+n-1;while(s1<s2) { t=*s1++; *s1=*s2-; *s2=t; } } main() { char *p; p="1234567"; fun(p,strlen(p)); puts(p); }
A.1234567
B.7654321
C.1711717
D.7177171
答案
参考答案:C
解析:[评析] 在子函数fun中,s1为字符串w的起始地址,s2为字符串的结束地址(字符’\0’除外),当执行循环结束循环, w=“1711717”。