home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
ARRV110.ZIP
/
XMSARRAY.ZIP
/
HUGHARR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-12
|
672b
|
33 lines
]#include "stdlib.h"
#include "alloc.h"
#include "virimg.h"
#define hugh_array(x) *((char *)large_array(x>>16,x&65535))
#define SZ 983040
void main()
{
long i,j,l;
initialise_virtual_arrays(3,65536,16);
printf ("Array size %ld chars\n",SZ);
printf ("Memory still available %ld\n",coreleft());
printf ("Press a key to check arrays\n");
getch();
start_timer();
printf ("Filling hugh array\n");
for (i=0;i<SZ;i++)
hugh_array(i)=(char)i;
printf ("Checking hugh array\n");
for (i=0;i<SZ;i++)
if (hugh_array(i)!=(char)i) goto ERR;
printf ("hugh array ok\n");
stop_timer();
exit(1);
ERR:
printf ("Error in hugh array");
}