• 2022-06-11
    下面程序 char * fun1(char *t,char *s){ while(*t=*s){s++,t++;} return t;}int main(){ char a[100]="Hello"; char b[20]="NEU"; char *t=NULL; t=fun1(a,b); printf("%s",t);}执行结果为
    A: HelloNEU
    B: Hello
    C: NEU
    D: 输出为空
  • D

    举一反三

    内容

    • 0

      函数fun的功能是: int fun(char *s){ char *t=s; while(*t++); return (t-s); }

    • 1

      中国大学MOOC: 有以下函数int fun(char t[],char s[]){ int i=0; while(s[i]!=0) t[i]=s[i++]; t[i]=; return i;}执行如下代码片段后 char s[]=NameLI; char t[100]; fun(t,s); printf(%s,t); 程序运行后的输出结果是[/i][/i][/i]

    • 2

      有以下函数int fun(char t[],char s[]){ int i=0; while(s[i]!=0) t[i]=s[i++]; t[i]='\0'; return i;}执行如下代码片段后 char s[]="Name\0LI"; char t[100]; fun(t,s); printf("%s",t); 程序运行后的输出结果是[/i][/i][/i] A: Name\0LI B: NameLI C: Name D: LI

    • 3

      有下列程序,程序运行后的输出结果是( )。 #include void fun(char *a,char *b) { while (*a=='*') a++; while(*b=*a) { b++; a++;} } int main() { char *s='****a*b****',t[80]; fun(s,t); puts(t); return 0; }

    • 4

      有以下函数 int fun(char *s) { char *t=s; while(*t) t++; return(t-s); } 该函数的功能是( ).