C++ 杂记

class C1
{
	
public:
	C1();
	~C1();
	C2 *pc2;//正确,可以在其他方法中pc2 = new C2(this)
	//pc2 = new C2(this);//错误,不能直接在方法外赋值
};


2

class A
{
   int a=0;//报错,data member initalizer is not allowed
   
  int a;//正确,然后可以在构造,或其他函数赋值
}


posted @ 2014-01-13 14:29  00000000O  阅读(162)  评论(0编辑  收藏  举报