Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!bbn.com!nic!chaos.cs.brandeis.edu!chaos!phils From: phils@chaos.cs.brandeis.edu (Phil Shapiro) Newsgroups: comp.sys.mac.programmer Subject: Re: Using Malloc to create variables. help? Message-ID: Date: 17 Jan 91 20:43:59 GMT References: <6996@crash.cts.com> Sender: phils@chaos.cs.brandeis.edu (Phil Shapiro) Organization: Symantec Corp. Lines: 20 In-Reply-To: kevin@crash.cts.com's message of 17 Jan 91 09:26:04 GMT In article <6996@crash.cts.com> kevin@crash.cts.com (Kevin Hill) writes: [ ... code deleted ... ] if ( (bigmap = (char *)( malloc( (100 * 100 * 32) * sizeof(char) + 1 ) )) == NULL) I missed the original posting, so forgive me if I missed something essential. The above line won't work, since 100 * 100 * 32 won't fit into a 16 bit integer value. If you use, say 100L, then this expression will work OK. Also, make sure you're including . -phil -- Phil Shapiro Technical Support Analyst Language Products Group Symantec Corporation Internet: phils@chaos.cs.brandeis.edu -- Phil Shapiro Technical Support Analyst Language Products Group Symantec Corporation Internet: phils@chaos.cs.brandeis.edu