X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Alex Vinokur" Newsgroups: comp.os.msdos.djgpp Subject: Re: Trouble of using very large arrays Date: Fri, 23 Apr 2004 19:08:53 +0300 Lines: 30 Message-ID: References: <4088E94D DOT 8070508 AT acm DOT org> NNTP-Posting-Host: 82.166.218.240 X-Trace: news.uni-berlin.de 1082736536 10524822 I 82.166.218.240 ([79865]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Martin Ambuhl" wrote in message news:c6bafb$a9mhn$2 AT ID-227552 DOT news DOT uni-berlin DOT de... > 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); -- Alex Vinokur mailto:alexvn AT connect DOT to http://mathforum.org/library/view/10978.html