Newsgroups: comp.os.msdos.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!ispd-newsserver!ism.isc.com!b1!ico!auto-trol!mattel From: mattel@auto-trol.com (Matt Telles) Subject: Re: Memory Models in TC2.0 Message-ID: <1991Jun4.212226.9402@auto-trol.com> Sender: news@auto-trol.com Nntp-Posting-Host: mattel Organization: Auto-trol References: <16854@helios.TAMU.EDU> <16856@helios.TAMU.EDU> Date: Tue, 4 Jun 1991 21:22:26 GMT In article <16856@helios.TAMU.EDU> x041sc@tamuts.tamu.edu (Sean Malloy) writes: >I'm sure that this is a question that should be included in a FAQ >for this group, but I couldn't find a general FAQ in the message >list. > > if ((ptr = ((OBJECT far *)malloc(sizeof(OBJECT)))) == NULL ) { > perror("New_object failed to allocate memory. ABEND"); > exit(0); Now, this would just be a guess, but I would say that you do not include the header file for malloc. This tells the compiler that the function returns an int, which it will happily convert to a pointer in small model. In large model, other weird things will happen. I could be completely wrong, in which case you can just ignore this... Matt the net.lurker -- ============================================================================== Matt Telles mattel@auto-trol.COM {...}ncar!ico!auto-trol!mattel Auto-trol Technology 12500 N Washington Denver, CO 80241-2404 (303)252-2874