[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: dumb C++ question
From:       Bernd Gehrmann <bernd () physik ! hu-berlin ! de>
Date:       1999-05-23 9:49:57
[Download RAW message or body]

On Sun, 23 May 1999 Mario Weilguni wrote:

>>if str == "", then the marked line will
>>do new QChar[0]. But what does it return?
>>A test said me, it returns something, but
>>what does it return? Is it defined? I must
>>admit, it's the first time I think about this
>>"problem" :)
>
>It returns the smallest block possible, 16 bytes. It need to return something,
>to be able to realloc() it lateron.

I'm not sure, but I don't think the C++ standard guarantees that using
an address allocated by operator new as realloc() or free() argument 
works. IMO one shouldn't mix C and C++ stuff at all. This can give all
sorts of trouble when new is overloaded or anything like this.

Bernd.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic