Xref: utzoo comp.lang.c:40288 comp.lang.c++:14269 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!uwm.edu!linac!att!ucbvax!ucdavis!castor!fzjaffe From: fzjaffe@castor (Rory Jaffe) Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: decalring large arrays Summary: A "new" approach Message-ID: <13324@aggie.ucdavis.edu> Date: 21 Jun 91 00:54:26 GMT References: <285B94A3.25253@maccs.dcss.mcmaster.ca> Sender: usenet@aggie.ucdavis.edu Reply-To: fzjaffe@castor.ucdavis.edu (Rory Jaffe) Followup-To: comp.lang.c Organization: Computing Services, UC Davis Lines: 19 In article <285B94A3.25253@maccs.dcss.mcmaster.ca> tomr@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. Since this is the c++ group, here is a C++ suggestion: I had a problem where I had to allocate a multidimensional large array. I went crazy figuring out how to cast the pointer until I contacted Borland: to allocate a 20 X 40 X 30 array: float (* arrayname)[40][30] = new float[20][40][30] ; to delete it delete arrayname ; // BC++ doesn't care to be told it's an array here to use it: arrayname[a][b][c] If the array is greater than 64K, just cast the pointer to huge in the above example.