home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20042 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1018 b 

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!ncar!noao!arizona!arizona.edu!ace!jjr
  2. From: jjr@ace.ece.arizona.edu (Jeffrey J. Rodriguez)
  3. Newsgroups: comp.lang.c
  4. Subject: HALLOC and HUGE ptrs in Microsoft C
  5. Message-ID: <1993Jan21.175608.4279@arizona.edu>
  6. Date: 22 Jan 93 00:56:06 GMT
  7. Distribution: world,local
  8. Organization: U of Arizona Electrical and Computer Engineeering
  9. Lines: 14
  10. Nntp-Posting-Host: ace.ece.arizona.edu
  11.  
  12. On a 486 running DOS, I need to allocate an array that's bigger than 64K,
  13. fill it up with data, and write it to a binary file.
  14. The MSC 7.0 manual says to use halloc(), which returns a "huge ptr".
  15. It also says that huge ptrs cannot be passed as args to library functions.
  16. Therefore, I can't pass the array to fwrite()!
  17. So, how do I write the data? (Do I really have to loop through putchar?)
  18.  
  19. This sure seems cumbersome.
  20. It also seems that a program written for PC-DOS using halloc and huge
  21. ptrs would not run on a Sun running UNIX.
  22. So much for portable C.
  23.  
  24. Jeff Rodriguez
  25. rodriguez@ece.arizona.edu
  26.