home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / programm / 4510 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.1 KB

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