home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.os2.programmer:4511 comp.os.os2.apps:5621 comp.os.os2.misc:28497
- Path: sparky!uunet!vnet.ibm.com
- From: dmm@vnet.ibm.com (dave)
- Message-ID: <19920828.103746.499@almaden.ibm.com>
- Date: Fri, 28 Aug 92 13:34:30 EDT
- Newsgroups: comp.os.os2.programmer,comp.os.os2.apps,comp.os.os2.misc
- Subject: Re: C Set/2 Question in malloc
- Organization: IBM Canada Lab
- News-Software: UReply 3.0
- X-X-From: dmm@vnet.ibm.com (Dave Mooney)
- References: <1992Aug28.154836.12867@natinst.com>
- Lines: 24
-
- In <1992Aug28.154836.12867@natinst.com> Uma Arunkumar writes:
- (hacked to get it past Nazi news software)
- > #include <stdio.h>
- > #include<malloc.h>
- > main()
- > {
- > [...]
- > if (( array= malloc(50 * sizeof(long)))!= NULL)
- > [...]
- > }
- >
- > I compile giving the command
- > icc /c /w3 /o+ sample.c
-
- If you're going to use malloc.h to pick up the prototype for malloc(),
- you should compile using /Sm . If you want to pick up the prototype no
- matter what, #include <stdlib.h> instead of <malloc.h>.
-
- dave
-
- -------------------------------------------------------------------------
- Dave Mooney dmm@vnet.ibm.com
- C Set/2 Development, IBM Canada Lab, 844 Don Mills Rd, Toronto, Ontario
- "If you've got a blacklist, I want to be on it"
-