首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

windows alloc.h sbrk解决方案

2013-01-12 
windows alloc.h sbrkhi, 最近迁移代码遇到问题。#include stdio.h #include alloc.h int main(void) {

windows alloc.h sbrk
hi, 最近迁移代码遇到问题。


#include <stdio.h> 
#include <alloc.h> 

int main(void) 

   printf("Changing allocation with sbrk()/n"); 
   printf("Before sbrk() call: %lu bytes free/n", 
   (unsigned long) coreleft()); 
   sbrk(1000); 
   printf(" After sbrk() call: %lu bytes free/n", 
   (unsigned long) coreleft()); 
   return 0; 
}

 这段程序在VS 2005中运行 提示错误:'alloc.h': No such file or directory
 若删去#include <alloc.h>
 就会出现提示错误:error C3861: 'sbrk': identifier not found
             'coreleft': identifier not found
我是在windows下运行的,此问题如何解决呢
[解决办法]
coreleft()); 确定 windows 可以用么
[解决办法]
sbrk还是不要用了吧。
[解决办法]
要想在Windows环境下稳定运行tc.exe
建一个批处理tc.bat,内容为下面两行,放在tc.exe同目录下,再将tc.bat发送到桌面快捷方式:
del tc*.swp >NUL
start command /c tc.exe
如果想在IDE里面使用鼠标,还应将快捷方式属性中的快速编辑模式关掉。

[解决办法]
编译时 warning
链接时 error

热点排行