linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marius Nita <marius@cs.pdx.edu>
To: linux-c-programming@vger.kernel.org
Subject: Re: [jason@txt.com: Re: Problem with "chars"]
Date: Thu, 18 Jul 2002 02:18:46 -0700	[thread overview]
Message-ID: <20020718021846.A3853@cs.pdx.edu> (raw)
In-Reply-To: <20020718122502.A20298@neutrino.particles.org>; from eathan@otenet.gr on Thu, Jul 18, 2002 at 12:25:02PM +0300

On Thu, Jul 18, 2002 at 12:25:02PM +0300, Elias Athanasopoulos wrote:
> 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.

Besides, why would you want to use malloc and calloc in c++ programs?
There's a reson that "new" exists. :)

> All we said in this thread is relative to C programmingm *only*.
> 
> Elias
> 
> -- 
> http://gnewtellium.sourceforge.net			MP3 is not a crime.	
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2002-07-18  9:18 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
2002-07-18  9:18   ` Marius Nita [this message]
  -- 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=20020718021846.A3853@cs.pdx.edu \
    --to=marius@cs.pdx.edu \
    --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).