home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mcsun!ieunet!tcdcs!maths.tcd.ie!tim
- From: tim@maths.tcd.ie (Timothy Murphy)
- Subject: Re: How to use large arrays in Think C?
- Message-ID: <1992Nov10.182129.21561@maths.tcd.ie>
- Organization: Dept. of Maths, Trinity College, Dublin, Ireland.
- References: <CSTROCKB.92Nov6235644@csws12.cs.sunysb.edu>
- Distribution: comp
- Date: Tue, 10 Nov 1992 18:21:29 GMT
- Lines: 25
-
- cstrockb@cs.sunysb.edu (Caleb Strockbine) writes:
-
- >For clarity and consistancy with the rest of the class, it would be great
- >if I could use regular array notation for this picture. For instance, if
- >I want to just run through every pixel in the image, I'd like to say:
-
- >short i, j;
-
- >for (i=0;i<256;i++)
- > for (j=0;j<256;j++)
- > ProcessPixel(image[i][j]);
-
- The answers to this query seemed over-complicated to me.
- Would it not be easier just to say
-
- char *image[256];
- ...
- for (i = 0; i < 256; i++)
- image[i] = malloc(256);
-
- --
- Timothy Murphy
- e-mail: tim@maths.tcd.ie
- tel: +353-1-2842366
- s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
-