Re: Casting the return value of malloc() ?
Keith Thompson <kst-u@mib.orgwrote:
True, but in the general case they'll be both bad C and worse C++.
_Correct_, yes, but horrible style.
>
As we've mentioned several times in this thread, P.J. Plauger seems to
have sound business reasons for doing this.
He does, but so far, he's the only one who has managed to convince me
that _in his specific case_, the advantages outweigh the downsides. In
every other case I've seen, the claim that "but I might want to compile
my C code as C++" is very simply put aside with the argument that you
just should not do that, as there are mechanisms in C++ to make such
half-hearted practices superfluous.
Richard
Keith Thompson <kst-u@mib.orgwrote:
Old Wolf <oldwolf@inspir e.net.nzwrites:
On Oct 3, 10:27 pm, Nick Keighley <nick_keighley_ nos...@hotmail. com>
Yes C and C++ are different. But you can write a programs
using a LARGE subset of C that will compile with C and C++.
using a LARGE subset of C that will compile with C and C++.
_Correct_, yes, but horrible style.
The question is, why would you want to do this?
You can write programs that compile in both C
and Fortran. But again, why would you?
Here's the reasons I can think of:
1) For curiosity's sake
2) You are an idiot
What's your reason?
You can write programs that compile in both C
and Fortran. But again, why would you?
Here's the reasons I can think of:
1) For curiosity's sake
2) You are an idiot
What's your reason?
As we've mentioned several times in this thread, P.J. Plauger seems to
have sound business reasons for doing this.
that _in his specific case_, the advantages outweigh the downsides. In
every other case I've seen, the claim that "but I might want to compile
my C code as C++" is very simply put aside with the argument that you
just should not do that, as there are mechanisms in C++ to make such
half-hearted practices superfluous.
Richard
Comment