decalring large arrays

Michael Salmon etxmesa at eos.ericsson.se
Thu Jun 20 18:23:47 AEST 1991


In article <285B94A3.25253 at maccs.dcss.mcmaster.ca> Rickey Thomas Tom writes:
> I have a simple question. I sort some data. The easiest way to do this is to 
> decalre a large array to sotre this data and then sort the array. However,
> it apopears that in a DOS environment, I am only allowed an array up
to 64 K in size. Is there a way to
> declare larger arrays than this for sort. Is there another way that I
could store a large quantity of data
> for sorting.
> 
You don't mention whether you want to sort a large number of small
objects or a number of large objects.
The later case can be solved by declaring an array of pointers as others
heve mentioned but the limit
is 16K (64K / sizeof far void *). If instead you want sort integers then
you are perhaps better off
investigating multiple file sorting algorithms or if it must be in
memory you can use a 16K array of 
pointers to 16K arrays of pointers to integers. The problem here of
course is that most published sort
algorithms only work for single dimensional arrays. I hope that this has
been some help. 



Michael Salmon
L.M.Ericsson
Stockholm

Standard disclaimer.



More information about the Comp.lang.c mailing list