// ClassA.cpp : Defines the entry point for the console application. // #include "stdafx.h" class A { int m_n; public: A() { m_n=0; printf("A::A()\n"); } A(int n) { m_n=n; printf("A::A(int)\n"); } A(A& other) { m_n=other.m_n; printf("A::A(A& other)\n"); } A(const A& other) { m_n=other.m_n; printf("A::A(const A& other)\n"); } /* A(A& other,int x=0) { m_n=other.m_n; printf("A::A(A& other,int x=0)\n"); } //*/ A(const A& other,int x=0) { m_n=other.m_n; printf("A::A(const A& other,int x=0)\n"); } }; int main(int argc, char* argv[]) { int i=2; A a_int(i); const A b(a_int,i); A c(b,i); //printf("Hello World!\n"); return 0; } /* A::A(int) A::A(A& other,int x=0) A::A(const A& other,int x=0) Press any key to continue */ /* A::A(int) A::A(const A& other,int x=0) A::A(const A& other,int x=0) Press any key to continue */