刚开始使用WATCOMC,听说可以直接申请超过64K的内存,编写个申请256K的程序测试(hello.c),用wcl hello.c编译后生成的hello.exe,在纯DOS环境执行显示申请失败。用wcl386 hello.c编译后生成文件,在纯DOS下执行显示this is a Windows NT character-mode executable ,请高手帮我指导下,这是怎么回事,如何解决。
我的测试程序如下:
/******hello.c****/
#include "stdio.h"
#include<malloc.h>
main()
{
unsigned char *a;
printf("Hello World!");
if(a=(unsigned char*)malloc(262144))
printf("\nok!!!!");
else printf("\nerror!!!");
getch();
}
我的测试程序如下:
/******hello.c****/
#include "stdio.h"
#include<malloc.h>
main()
{
unsigned char *a;
printf("Hello World!");
if(a=(unsigned char*)malloc(262144))
printf("\nok!!!!");
else printf("\nerror!!!");
getch();
}

