C++ new/delete

Started by
1 comment, last by Aroidzap 11 years, 8 months ago
Simple, fast question.

is :
char *data=new char[256];
delete[] data;
char *data=new char[256];
delete[] data;

equal to :
char *data=new char[256];
char *data=new char[256];
delete[] data;


?
Advertisement
No. The second won't delete the first allocation.
thanks

This topic is closed to new replies.

Advertisement