以下是引用embed_xuel在2013-1-11 13:18:10的发言:
你确定你的代码不是书上的错误代码示例吗?
这种写法以前是正确的你确定你的代码不是书上的错误代码示例吗?
不过这明显是个不合理的问题
新编译器里不支持了

个性太多,无法显示
程序代码:/* * * * * * * * 头 文 件 包 含 * * * * * * * */
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
/* * * * * * * * 函 数 声 明 * * * * * * * */
void copy(char *s,char *q);
/* * * * * * * * 函 数 定 义 * * * * * * * */
void copy(char *s,char *q)
{
while(*q++ = *s++); //判断函数优化
}
/* * * * * * * * 主 函 数 * * * * * * * */
int main(void)
{
char *str = "Hello world"; //定义字符串常量str
char *p,*temp;
p = calloc(strlen(str) + 1, sizeof(char)); //分配空间并初始化
temp = p; //设置临时变量暂存p
copy(str,p); //函数调用
p = temp; //设p为字符串起始的位置,以便下面输出
printf("%s\n",p);
getch(); //输入一个字符
return 0; //程序结束
}