All pastes #957774 Raw Edit

Something

public text v1 · immutable
#957774 ·published 2008-03-26 05:20 UTC
rendered paste body
Foo** tehList = new Foo*[5];tehList[0] = new Foo();tehList[1] = new Foo();tehList[2] = new Foo();tehList[3] = new Foo();tehList[4] = new Foo();delete tehList[2];//tehList[2] is now deallocated, and pointing to junk in memoryFoo* aFoo = tehList[0];//it's an array of foo pointers//before doing delete[] tehList, you have to make sure all its elements were//deleted too.