LARGE ARRAYS: example
marwk at levels.sait.edu.au
marwk at levels.sait.edu.au
Thu Dec 13 02:20:49 AEST 1990
If you were to change the far pointer to a huge pointer then you
would have the correct results displayed for a huge amount of data.
Ray
-----------------------
#include <stdio.h>
#include <alloc.h>
typedef char far * MYLARGE; /* change far to huge */
long i;
MYLARGE lots;
#define SIZE 65538L
void main(void)
{
lots = (MYLARGE) farmalloc(SIZE);
for (i = 0; i < SIZE; ++i)
lots[i] = i % 10L + 1;
for (i = 0; i < 10L; ++i)
printf("%ld: %2d\n", i, lots[i]);
}
More information about the Comp.lang.c
mailing list