Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
execution of constructor and destructor
//g++ 5.4.0 #include <iostream> using namespace std; class myclass { public: int who; myclass(int id); ~myclass(); }glob_ob1(1),glob_ob2(2); myclass::myclass(int id) {cout<<"\nintializing\n"; who =id; cout<<id; } myclass::~myclass() { cout<<"destructor\n"; } int main() { myclass local_ob1(3); cout<< "in main()\n"; myclass local_ob2(4); cout<<"\nafter main\n"; return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
cons1
ignat2
Text Justification
HelloWorld
Tray
HeapSort
1234
inheritance
Template HeapSort
TIME
Please log in to post a comment.