delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/21/17:51:39

Sender: root AT delorie DOT com
Message-ID: <38B1567F.85707A1C@inti.gov.ar>
Date: Mon, 21 Feb 2000 12:15:11 -0300
From: salvador <salvador AT inti DOT gov DOT ar>
Organization: INTI
X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.38 i686)
X-Accept-Language: es-AR, en, es
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: new vs malloc
References: <38AD8622 DOT AE067F97 AT tiscalinet DOT it> <004101bf7a97$06ff2ca0$cff0fea9 AT stevenhe> <88lt6e$9pj$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <01bf7ba9$8fb5a980$c3247d81 AT default> <88m9hb$7ar$1 AT news2 DOT isdnet DOT net>
Reply-To: djgpp AT delorie DOT com

-hs- wrote:

> Why ? Simply because <stdlib.h> is missing, that implies that the default
> return type of malloc() is int (also the parameters).

That's wrong in C++, for C++ you *must* do a cast because void * -> char * isn't
allowed without a cast.
And yes, you could need to use malloc in C++, specially when you mix C and C++
code (libc is C).

SET

--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
                    set AT ieee DOT org set-soft AT bigfoot DOT com
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013



- Raw text -


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