home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!uicvm.uic.edu!u37956
- Organization: University of Illinois at Chicago
- Date: Friday, 21 Aug 1992 11:46:05 CDT
- From: <U37956@uicvm.uic.edu>
- Message-ID: <92234.114605U37956@uicvm.uic.edu>
- Newsgroups: comp.lang.c
- Subject: Large memory problem
- Lines: 31
-
- I am using Ms C 6.0 on DOS5.0 . I have 4MB extented memory.
- The following C code is causing me trouble:
-
- #include <stdio.h>
- main()
- ñ int i;
- unsigned char *buffer;
-
- buffer=(unsigned char*)malloc(480000);
- for(i=0; i<480000; i++)
- ñ
- buffer[i]= i%256;
- printf("%u\n", buffer[i]);
- ç
- ç
-
-
-
- It is compiled in large(or huge) memory model:
-
- cl /AL myprog.c
-
- When I run the program, it prints out the numbers, but in the end, it
- gives message" memory allocation error, Can't load COMMAND, the system
- halted.", and then the system dies.
-
- What's wrong ?
-
- Any help will be appreciated.
-
- U37956@uicvm.uic.edu
-