From: Elias Athanasopoulos <eathan@otenet.gr>
To: Alvarez Alberto-AALVARB1 <AALVARB1@motorola.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: [jason@txt.com: Re: Problem with "chars"]
Date: Thu, 18 Jul 2002 12:25:02 +0300 [thread overview]
Message-ID: <20020718122502.A20298@neutrino.particles.org> (raw)
In-Reply-To: <75B979779CA1D311808400508B6F40FF05B9BE62@zes06exm01.madrid.ecid.cig.mot.com>; from AALVARB1@motorola.com on Thu, Jul 18, 2002 at 09:11:33AM +0200
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 <stdio.h>
> #include <stdlib.h>
>
> 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.
next prev parent reply other threads:[~2002-07-18 9:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-18 7:11 [jason@txt.com: Re: Problem with "chars"] Alvarez Alberto-AALVARB1
2002-07-18 9:25 ` Elias Athanasopoulos [this message]
2002-07-18 9:18 ` Marius Nita
-- strict thread matches above, loose matches on Subject: below --
2002-07-17 14:33 xlp
2002-07-17 17:55 ` Elias Athanasopoulos
2002-07-17 17:55 ` Jason P. Winters
2002-07-17 18:07 ` Glynn Clements
2002-07-17 18:24 ` Jason P. Winters
2002-07-17 18:54 ` Glynn Clements
2002-07-17 18:16 ` Elias Athanasopoulos
2002-07-17 19:30 ` Marius Nita
2002-07-18 14:43 ` Earl R. Lapus
2002-07-24 19:56 ` Mike Castle
2002-07-24 21:05 ` Jason P. Winters
2002-07-24 22:38 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020718122502.A20298@neutrino.particles.org \
--to=eathan@otenet.gr \
--cc=AALVARB1@motorola.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).