Hi, I think this may help you to get clarification, please see once. :) class student { int x; public: student() { x=0; } ~student() { cout<<"I am in student destructor\n"; } }; student* fun() { student *s = new student(); return s; } int main() { student *s = fun(); delete s; getchar(); return 0; }