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