www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/02/06:00:14.2

Path: news.mv.net!news.shore.net!newsfeed.mathworks.com!europa.netcrusader.net!194.176.220.130!newsfeed.icl.net!diablo.theplanet.net!news.theplanet.net!newspost.theplanet.net!not-for-mail
From: dontmailme AT iname DOT com (Steamer)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ok, I have more info on problem at hand
Date: Sat, 02 Sep 2000 09:59:07 GMT
Organization: always disorganized
Lines: 19
Message-ID: <39b0cf4d.8968418@news.freeserve.net>
References: <Mtg9LD_00Uw9QI9Fw3 AT andrew DOT cmu DOT edu>
Reply-To: dontmailme AT iname DOT com
NNTP-Posting-Host: modem-211.garibaldi.dialup.pol.co.uk
X-Trace: news5.svr.pol.co.uk 967888748 13581 62.137.16.211 (2 Sep 2000 09:59:08 GMT)
NNTP-Posting-Date: 2 Sep 2000 09:59:08 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Free Agent 1.11/32.235
Xref: news.mv.net comp.os.msdos.djgpp:103073

James W Sager Iii wrote:

> Either way, malloc and remalloc are no longer working with this updated
> version of c/c++

It would help if you knew which of the two languages you were using.

> Here is my code:
> 
> int *i;
> i=malloc(20);
> i=realloc(100);

This is valid C, and gcc accepts it without any problem if you compile
it as C.  It is not valid C++, so gcc will refuse to compile it as C++.
If you really insist on using `malloc' and `realloc' in C++ (rather than
`new') then you must cast the return value to the appropriate type.

S.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019