in C++ on following code:
class Foo {
vector<Foo*> otherFoos;
};
int _tmain(int argc, _TCHAR* argv[])
{
Foo* data = new Foo[5];
delete data;
}
I'm using Visual Studio 2013. I have no idea what is wrong with my code whatsoever.
You should write delete [] data;
. delete
for new
, delete[]
for new[]
.