A(A& other,int x=0)//*/ A(const A& other,int x=0)

来源:互联网 发布:虚拟机软件有哪些 编辑:程序博客网 时间:2024/05/16 05:24
// 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*/

原创粉丝点击