// File: ex4-2.cpp
#include <iostream>
using namespace std;
class Test
{
private:
char ch;
public:
Test(char); // constructor
~Test(); // destructor
};
Test::Test(char c)
{
ch = c;
cout << "*** constructor called for object " << ch << endl;
}
Test::~Test()
{
cout << "destructor called for object " << ch << endl;
}
int main(void)
{
Test a('a');
{
Test b('b');
}
{
Test c('c');
{
Test d('d');
}
}
}