码迷,mamicode.com
首页 > 其他好文 > 详细

A的对象和new出来的对象有什么区别

时间:2015-03-19 18:26:07      阅读:274      评论:0      收藏:0      [点我收藏+]

标签:

#include <iostream>

using namespace std;


class A
{
public:
	A(){ cout << nInt << endl; };
private:
	unsigned int nInt;
};


int main()
{
	A a;

	A * nA = new A;
	if ( nA )
	{
		cout << "我是对象" << endl;
	}

	system("pause");
	return 0;
}


这样a和nA有什么区别.我就不明白这样会有什么意思的啊

A的对象和new出来的对象有什么区别

标签:

原文地址:http://blog.csdn.net/lrstom/article/details/44461307

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!