Benjamin Scott <[EMAIL PROTECTED]> wrote:
> 
> It's simple to know if the Malloc command was
> successful.

Please quote the relevant part of any message you reply to.
The OP was careful to call it 'malloc()'.

Note that neither C nor C++ have 'commands', they have
functions.

> If it returns a pointer, it was successful, otherwise
> it returns a Null.

More precisely it returns a null pointer which will
compare equal to the macro NULL (if a relevant
header is included.)

You still need to be careful allocating memory though.
You may get false positives on lazy allocation operating
systems that always return success. It's only when you
try to access the allocated memory that it seg-faults.

So, definitely check the return value, but don't go
overboard with your allocations.

-- 
Peter

Reply via email to