#include <iostream.h>
#include<conio.h>
/*----------------------Class definition-------------------------*/
class sample
{
int x;
public:
sample();
int get_data() { return x; }
~sample(); // Destructor Declaration
};
sample::sample()
{
cout << "Executing the Constructor...\n\n";
}
sample::~sample() // Destructor Definition
{
cout << "\nExecuting the Destructor...\n";
}
/*----------------------Definition ends here---------------------*/
sample globalobj; // global object
void main(void)
{
cout << "Entering MAIN...\n";
cout << "x = " << globalobj.get_data() << "\n";
cout << "Exiting MAIN...\n";
getch();
}
1 comments:
wonderful post, very informative. I'm wondering why the opposite specialists of this sector don't understand this.
You must continue your writing. I'm sure, you've a great readers' base already!
my weblog :: cellulite treatment
Post a Comment