Re: Weird malloc behaviour
- From: comeau@xxxxxxxxx (Greg Comeau)
- Date: 31 Jul 2008 16:38:03 -0400
In article <2m549493pe2ke73dv6hb705e8o8riahq4k@xxxxxxx>,
Barry Schwarz <schwarzb@xxxxxxxx> wrote:
On Thu, 31 Jul 2008 19:45:46 +0100, Ben Bacarisse
<ben.usenet@xxxxxxxxx> wrote:
Barry Schwarz <schwarzb@xxxxxxxx> writes:
<snip>
... A few of the common correct uses of a cast are:
I'd add: passing a T ** (or a T *const *) to a function that wants a
const T *const * parameter.
Is there not a one way implicit conversion adding as many const as
needed? A T* will be converted to const T* with no problem (e.g.,
strcpy). Is a T** different?
It's different, surprisingly so. :(
Check out http://www.comeaucomputing.com/techtalk/#deconstutoh
--
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
.
- References:
- Weird malloc behaviour
- From: leptone
- Re: Weird malloc behaviour
- From: Barry Schwarz
- Re: Weird malloc behaviour
- From: Ben Bacarisse
- Re: Weird malloc behaviour
- From: Barry Schwarz
- Weird malloc behaviour
- Prev by Date: Re: Which is faster?
- Next by Date: Re: Which is faster?
- Previous by thread: Re: Weird malloc behaviour
- Next by thread: Re: FREAD fails on files >4GB
- Index(es):
Relevant Pages
|