home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.programming
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!mimbres.cs.unm.edu!constellation!a.cs.okstate.edu!saeed
- From: saeed@a.cs.okstate.edu (SAEED FAISEL)
- Subject: BIG arrays in TC
- Message-ID: <1992Nov6.214233.17682@a.cs.okstate.edu>
- Organization: Oklahoma State University, Computer Science, Stillwater
- Date: Fri, 6 Nov 92 21:42:33 GMT
- Lines: 36
-
-
- /*
- PLEASE HELP !!!
-
- I am trying to allocate two arrays of 512x512 each.
-
- the following code compiles successfully on TC 2.0
- but cannot allocate the desired memory.
-
- what do I need to do ?
- */
-
- #include <mem.h>
- #include <stdio.h>
-
- #define Image_Size (unsigned long) (512 * 512)
-
- main ()
- {
- unsigned char far *I, *O;
-
- if ((I = farcalloc (Image_Size, sizeof (unsigned char))) == NULL)
- printf ("memory allocation error.\n");
- else
- printf ("%ld bytes allocated at %Fp\n", Image_Size, I);
-
- if ((O = farcalloc (Image_Size, sizeof (unsigned char))) == NULL)
- printf ("memory allocation error.\n");
- else
- printf ("%ld bytes allocated at %Fp\n", Image_Size, O);
- }
- --
-
- Faisel Saeed
- Computer Science Department, Oklahoma State University, Stillwater, OK
- ---------------------------------------------------------------------------
-