Wednesday 1 February 2012

Distructor in C++ Simple Example

class Test{


private:
int n;
public:
Test(){
cout<<<"object  created.."<<endl;
}

~Test(){
cout<<<"Object destroyed.."<<endl;
}


};
void main(){
clrscr();
Test a, b;
getch();
}
}

No comments:

Post a Comment