阅读背景:

函数指针传参和引用传参的区别

来源:互联网 

先看一段代码

class CTest
{
public:
	CTest(int a, int b) : m_a(a), m_b(b){}
private:
	int m_a;
	int m_b;
};


void fun(CTest* ab)
{
	delete ab;
}
int main(){
	
	CTest *ab = new CTest(1,2);
	fun(ab);
	
	if (ab == NULL)
	{
		cout << "delete";
	}
	return 0;
}class CTest
{
public:
	CTest(int a,



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: