[comp.lang.c] LARGE ARRAYS: example

marwk@levels.sait.edu.au (12/12/90)

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]);
    }