Original Post
Hello I'm playing a little bit with polymorphysm in my program, and i was wondering something: Suppose i do something like that; class ClassA { int a; }; class ClassB: public class ClassA { int b; }; and then in my code: ... ClassA* ptr = (ClassA*)new ClassB; delete ptr ; .. Does the "delete A" free all the memory or does it only free the memory used by a class of type A .... In other word: do you think i will suffer of memory leaks with such a piece of code ? Thanks a lot !!! Clem