C++构造函数与复制构造函数调用情况

#include "IPermanceServiceShare.h"
#include <string>
#include <deque>
#include <iostream>
using namespace std;

class CAnimal
{
public:
CAnimal(){ cout << " Animal constrcutio invoke " << endl; }
CAnimal(const CAnimal &animal){cout << "Animal copy construction invoke" << endl; }
~CAnimal(){};
};

void main()
{

CAnimal example;
CAnimal example2(example);
/*************************************
*输出:
*Animal constrcutio invoke
*Animal copy construction invoke
*
*************************************/

int wait;
cin >> wait;


}

posted @ 2013-06-26 18:44  Predator  阅读(174)  评论(0编辑  收藏  举报