为什么老是提示找不到包含文件

海大富运动 2005-05-08 05:59:55
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void main()
{
int n;
char *p;
p=(char*)malloc(10*sizeof(char));
printf("请输入一串字符串:");
scanf("%s",p);
n=strlen(p);
printf("%d",n);
if(n>9)
{
printf("\n",n);
p=(char*)realloc(p,sizeof(char));

}

free(p);
}

我的环境是xp+turboC2
...全文
139 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
horisly 2005-05-08
  • 打赏
  • 举报
回复
应该是tc设置问题,不过我好久没有tc了。
oyljerry 2005-05-08
  • 打赏
  • 举报
回复
确保路径是否正确
llf_hust 2005-05-08
  • 打赏
  • 举报
回复
我这里编译没有问题
可能是你的TC设置有问题
lbing7 2005-05-08
  • 打赏
  • 举报
回复
> realloc 包含于alloc.h中
realloc包含与stdlib.h中

...................................
好像是两个都有

lingzantia 2005-05-08
  • 打赏
  • 举报
回复
TC路径设置问题吧
zhang_jiang 2005-05-08
  • 打赏
  • 举报
回复
> realloc 包含于alloc.h中
realloc包含与stdlib.h中
ericqxg007 2005-05-08
  • 打赏
  • 举报
回复
realloc 包含于alloc.h中
如果不是这个问题的话就是你的 inlcude 路径有问题
zhang_jiang 2005-05-08
  • 打赏
  • 举报
回复
把错误信息贴出来吧.

69,382

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧