home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / os2 / programm / 7936 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.0 KB  |  24 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!think.com!sdd.hp.com!decwrl!csus.edu!netcom.com!ljensen
  3. From: ljensen@netcom.com (Colin Jensen)
  4. Subject: Re: malloc() and swapper.dat problems ....
  5. Message-ID: <1993Jan23.185932.20991@netcom.com>
  6. Organization: Netcom - Online Communication Services (408 241-9760 guest)
  7. References: <1993Jan10.200412.454149@sue.cc.uregina.ca> <1993Jan19.154532.20484@solaris.rz.tu-clausthal.de> <1993Jan20.144643.9495@njitgw.njit.edu>
  8. Date: Sat, 23 Jan 1993 18:59:32 GMT
  9. Lines: 13
  10.  
  11. In article <1993Jan20.144643.9495@njitgw.njit.edu> dic5340@hertz.njit.edu (David Charlap) writes:
  12. >In article <1993Jan19.154532.20484@solaris.rz.tu-clausthal.de> catd@rz.tu-clausthal.de writes:
  13. >>   p = ( int *) malloc( sizeof(int)*120...0);
  14. >
  15. >The (int *) cast is unnecessary in ANSI-C.  malloc() returns a (void
  16. >*) which is compatible with everything.
  17.  
  18. Unfortunately, the cast is neccesary in C++, so the cast should be used
  19. for better portability.
  20.  
  21. -- 
  22. Colin Jensen
  23. ljensen@netcom.netcom.com    cjensen@ampex.com
  24.