View Single Post
Old 04-15-2005, 06:41 PM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,709
redhead is on a distinguished road
Nothing in the ANSI C/C++ state that memory allocated by new or malloc will be filled with NULL, all it states is that the memory will be reserved for your use..
What you want to check for when creating it, is if malloc returns NULL, then an error has happened, same thing goes for new.. but nothing ever said that it would initialy set the memory allocated to NULL.

edit... woohoo, my number 700 post... yay me...
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is online now   Reply With Quote