X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <40894F42.B60859A7@yahoo.com> From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Trouble of using very large arrays References: <4088E94D DOT 8070508 AT acm DOT org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 27 Date: Fri, 23 Apr 2004 17:29:04 GMT NNTP-Posting-Host: 12.76.141.185 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1082741344 12.76.141.185 (Fri, 23 Apr 2004 17:29:04 GMT) NNTP-Posting-Date: Fri, 23 Apr 2004 17:29:04 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Alex Vinokur wrote: > "Martin Ambuhl" wrote in message >> Cesar Rabak wrote: >>> Brian Inglis escreveu: >> >>>> this is cleaner and more maintainable: >>>> >>>> a = malloc(rows * columns * sizeof *a); >>>> >>> This is not a good advice: you're changing the allocation of an >>> object of (rows x columns) ints to another of (rows x columns) >>> pointers to int. >> >> You are, I regret to say, in error. The type of *a is int, not >> pointers-to-int. > > You are right. So, > a = malloc(rows * columns * sizeof a); ^^ No no, 1000 times no, that should be "*a". -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net) Available for consulting/temporary embedded and systems. USE worldnet address!