home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!spool.mu.edu!darwin.sura.net!udel!sbcs.sunysb.edu!sbcs!cstrockb
- From: cstrockb@cs.sunysb.edu (Caleb Strockbine)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: How to use large arrays in Think C?
- Message-ID: <CSTROCKB.92Nov7145158@csws8.cs.sunysb.edu>
- Date: 7 Nov 92 19:51:58 GMT
- References: <CSTROCKB.92Nov6235644@csws12.cs.sunysb.edu> <1992Nov7.134925.21715@kth.se>
- Sender: usenet@sbcs.sunysb.edu (Usenet poster)
- Distribution: comp
- Organization: SUNY at Stony Brook Computer Science Dept.
- Lines: 26
- In-Reply-To: d88-jwa@alv.nada.kth.se's message of Sat, 7 Nov 1992 13: 49:25 GMT
- Nntp-Posting-Host: csws8.ic.sunysb.edu
-
- In article <1992Nov7.134925.21715@kth.se> d88-jwa@alv.nada.kth.se (Jon Wdtte) writes:
- Well, I would recommend getting a decent C reference, like
- "The C Programming language" by K&R. I have hacked in "C" for
- like 5-10 years, and still need to look stuff up sometimes
-
- I've got K&R, and I agree... I refer to it constantly. In fact, I
- carry it in my backpack constantly. Very good advice, though.
-
- Instead, use a typedef for one row, like:
-
- typeDef unsigned char arrayRow [ 256 ] ;
-
- and allocate several of them:
-
- arrayRow * foo = malloc ( sizeof ( arrayRow ) * 256 ) ;
-
- This will give you the indirection you want:
-
- foo [ 1 ] [ 2 ] = ...
-
- This is just what I needed to hear. Thanks ever so much! Now to get
- back to work...
-
- Caleb.
- --
- This message has been brought to you by the letters C and S and the number 3.
-