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

学习需要安静。。海盗要重新来过。。
2008-05-14 11:26
2008-05-15 17:40

2008-05-15 17:59
2008-05-15 19:57
2008-05-15 23:03
2008-05-16 05:34
2008-05-16 09:29
2008-05-16 09:38
程序代码:
#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;
}

2008-05-17 02:46
2008-05-17 03:29