单选题:下面的程序执行后,文件 test中的内容是()。
下面的程序执行后,文件 test中的内容是()。
void fun(char * fname, char *st)
{ FILE * myf; int i;
myf = fopen(fname, "w");
for(i = 0; i<strlen(st); i++) fputc(st i], myf);
fclose(my f); }
int main(void)
{ fun("test" , "new world");
fun("test" , "hello, ");
return 0;
}
A.new worldhello,
B.hello,
C.new world
D.hello, rld
答案:B
void fun(char * fname, char *st)
{ FILE * myf; int i;
myf = fopen(fname, "w");
for(i = 0; i<strlen(st); i++) fputc(st i], myf);
fclose(my f); }
int main(void)
{ fun("test" , "new world");
fun("test" , "hello, ");
return 0;
}
A.new worldhello,
B.hello,
C.new world
D.hello, rld
答案:B