given
is there still 5 MyClasses's on the heap?Code:int main() { stack<MyClass *> s; MyClass *m; int i; for(i = 0; i < 5; i++) { m = new MyClass; //.... some code dealing with m s.push(m); } while(!s.empty()) s.pop(); return 0; }
in other words, will the stack (container) clean up for me or not?