Delete [] operator
when a delete operator is called to some variable, does that
variable get assigned to NULL? For Example:
delete [] buffer;
frees up the memory held by buffer.
So is buffer now assigned to NULL?
It seems like in Windows 98/Me it works ok
but in Windows NT 4.0 I get an "Access Violation" error whenver I checked for a NULL against the variable after I delete it.
Yes! There are kangaroos in Australia but I haven't seen them...yet
Well in the VC++ documentation all it says is that it frees the memory, nothing about setting it to NULL. Why don''t you just put:
buffer = NULL
after you call delete?
Digital Radiation
buffer = NULL
after you call delete?
Digital Radiation
Since i didn''t get any run-time errors in Windows Me I left it out. But when I tried it on the Windows NT system, I got the
error!
error!
Yes! There are kangaroos in Australia but I haven't seen them...yet
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement