我基础也有缺陷..也不知道问什么,呵呵,知道的说下啊...谢谢

学习需要安静。。海盗要重新来过。。
程序代码:
#include <stdio.h>
char *test(char *p)
{
int i;
char a[100]="I love you!";
p=a;
//这里的printf就是问题的关键,保留时main函数中输出正常,注释后就会出错。
// printf("%s\n",p);
return(p);
}
int main(void)
{
char *p, *q;
p="there is a example";
q=test(p);
printf("\n截后的串为:%s\n",q);
return 0;
}
程序代码:
#include <stdio.h>
char *test(char *p)
{
int i;
char a[100]="I love you!";
p=a;
return(p);
}
int main(void)
{
char *p, *q;
p="there is a example";
puts("此次IO后可以正常输出I love you!,注释本行后输出出错");
q=test(p);
printf("\n截后的串为:%s\n",q);
return 0;
}
