#include #include using namespace std; class duo { int member1; int member2; public: duo(int initial_member1, int initial_member2); }; class mono { int member1; public: mono(int initial_member1); mono(const mono& another); //copy constructor }; class zero { public: zero(); }; int main() { duo d1(10, 20); //duo d2; //won't compile: constructor needs arguments mono m1(10); mono m2 = 10; //another way to do the same thing when the //constructor has exactly one argument //zero z1(); //creates no object, calls no constructor zero z2; //call a constructor that has no arguments int i = 10; int j(10); //another way to do same thing mono m3 = m1; //call copy constructor: m3.mono(m1) return EXIT_SUCCESS; } duo::duo(int initial_member1, int initial_member2) { cout << "constructor for duo\n"; member1 = initial_member1; member2 = initial_member2; } mono::mono(int initial_member1) { cout << "constructor for mono\n"; member1 = initial_member1; } mono::mono(const mono& another) //copy constructor { cout << "copy constructor for mono\n"; member1 = another.member1; } zero::zero() { cout << "constructor for zero\n"; }