1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#include "iostream.h" #include "a.h" AA::AA(char *arg) { cout << "A constructor " << arg << "\n"; argstr = arg; } AA::~AA() { cout << "A destructor " << argstr << "\n"; } AA a("a");; AA b("b");; /* AA f; */ B::B() { cout << "B constructor\n"; } B::~B() { cout << "B destructor\n"; }