Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!shelby!lindy!news From: LC.YRS@forsythe.stanford.edu (Richard Stanton) Newsgroups: comp.sys.ibm.pc Subject: Re: > 64 K Message-ID: <5743@lindy.Stanford.EDU> Date: 13 Nov 89 23:51:14 GMT Sender: news@lindy.Stanford.EDU (News Service) Distribution: usa Lines: 26 In article <1989Nov11.184105.29291@ccu.umanitoba.ca>, rahardj@ccu.umanitoba.ca (Budi Rahardjo) writes: >I have another problem. I'd like to load a binary file (about 150 K) >into the memory and use it as my data (using pointer or array). >I'm trying to write the program with MSC 5.1 using Large or Huge model. >and so far no luck. >It was easy to do this on Sun workstation. In MS C (at least in Quick C, which I use), you can use arrays larger in size than 64k in huge models, but you cannot just set aside space for them by using a line like char bigarray[150000]; You have to use one of the memory allocation functions (e.g. malloc, calloc) to explicitly request storage for your array before you use it. These functions return a pointer to the allocated space if successful, or else NULL if the allocation failed. For very large arrays, there are also some restrictions about the size of each element being a power of 2, I seem to remember, but if you are just using char or int, this should not be a problem. Richard Stanton PSTANTON@gsb-what.stanford.edu