Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ucsd!nosc!crash!kevin From: kevin@crash.cts.com (Kevin Hill) Newsgroups: comp.sys.mac.programmer Subject: Re: malloc() Help Message-ID: <7442@crash.cts.com> Date: 6 Feb 91 15:39:43 GMT References: <15828@milton.u.washington.edu> Organization: Crash TimeSharing, El Cajon, CA Lines: 32 In <15828@milton.u.washington.edu> bose@milton.u.washington.edu (Rob Olsen) writes: >For some reason, I have trouble using malloc() in THINK C. >Here is an example: >doit(num) >int num; >{ > char *back; > back=malloc(num); >} Try including In your file #include & #include I had the same problem a while ago and that solved it.. Write back if that does not work as I was having problems with malloc a while ago and asked the net about it. Also, look for the Frequently asked Question file as it goes over a lot of the basics... Feel free to ask though, as I feel that I know a lot about memory allocation via malloc or NewPtr because I just spent about 2 weeks trying to get the darn things to work the way I wanted on My Mac! Good luck, Kevin -- ******************************************************************************* * Kevin Hill * San Diego State University, Accounting Major. * No matter where you go, there you are. ******************************************************************************* * \ * *=====+)--------------------------- * / * San Diego State Fencing *******************************************************************************