home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.os2.programmer:4510 comp.os.os2.apps:5620 comp.os.os2.misc:28495
- Newsgroups: comp.os.os2.programmer,comp.os.os2.apps,comp.os.os2.misc
- Path: sparky!uunet!stanford.edu!ames!riacs!pan.arc.nasa.gov!roelofs
- From: roelofs@pan.arc.nasa.gov (Greg Roelofs)
- Subject: Re: C Set/2 Question in malloc
- Message-ID: <1992Aug28.170307.21637@riacs.edu>
- Followup-To: comp.sources.programmer
- Sender: news@riacs.edu
- Organization: University of Chicago
- References: <1992Aug28.154836.12867@natinst.com>
- Date: Fri, 28 Aug 92 17:03:07 GMT
- Lines: 17
-
- First of all, there was no reason to crosspost this query. Follow-ups
- to c.o.os2.programmer.
-
- uma@natinst.com (Uma Arunkumar) writes:
-
- >SAMPLE.C(12:15) : error EDC0117: The operation between these types is not valid.
- >SAMPLE.C(12:10) : informational EDC0140: Operand has type pointer to signed long integer .
- >SAMPLE.C(12:17) : informational EDC0140: Operand has type signed integer .
- >
- > if (( array= malloc(50 * sizeof(long)))!= NULL)
- >
- >What is wrong in the above code?
-
- Exactly what it tells you: malloc() is assumed to return int by default.
- Add (long *) in front of it.
-
- Greg Roelofs
-