From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elias Athanasopoulos Subject: Re: [jason@txt.com: Re: Problem with "chars"] Date: Thu, 18 Jul 2002 12:25:02 +0300 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: <20020718122502.A20298@neutrino.particles.org> References: <75B979779CA1D311808400508B6F40FF05B9BE62@zes06exm01.madrid.ecid.cig.mot.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <75B979779CA1D311808400508B6F40FF05B9BE62@zes06exm01.madrid.ecid.cig.mot.com>; from AALVARB1@motorola.com on Thu, Jul 18, 2002 at 09:11:33AM +0200 List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alvarez Alberto-AALVARB1 Cc: linux-c-programming@vger.kernel.org On Thu, Jul 18, 2002 at 09:11:33AM +0200, Alvarez Alberto-AALVARB1 wrote: > % g++ probo3.c > probo3.c: In function `int main()': > probo3.c:7: ANSI C++ forbids implicit conversion from `void *' in assignment > > while my program is this: > > #include > #include > > int main() > { > char *aux; > aux=calloc(2, sizeof(char)); > } > > ?Does anyone know the reason for this behaviour? I've always thought that C++ and C were almost the same at this kind of stuff. No they are not. C permits implicit conversion from void *, C++ forbids it. All we said in this thread is relative to C programmingm *only*. Elias -- http://gnewtellium.sourceforge.net MP3 is not a crime.