首页 > 试题广场 >

下列说法正确的是( &nbs...

[单选题]
下列说法正确的是(      )
#include "stdio.h"
#include "string.h"

void fun( char *s)
{
char t[7];
s=t;
strcpy(s, "example");
}

int  main()
{
char *s;

fun(s);
printf("%s",s);

return 0;
}
  • 输出结果为"example"
  • 输出结果为"烫烫烫烫"
  • 程序编译时出现错误
  • 程序运行时出现错误
会出现段错误,运行时报错
发表于 2019-08-26 10:52:36 回复(0)
在函数体内声明的一般局部变量会被销毁
发表于 2019-08-22 11:54:25 回复(0)
这个是因为t[7]越界了吧
发表于 2019-09-16 14:22:06 回复(0)