以下是我写的c++程序代码,求哪位大神看看为什么进入不了F()函数里面!!!谢谢了
#include<iostream>
using namespace std;
class Test
{
public:
int a;
int b;
public:
Test(int a, int b)
{
this->a = a;
this->b = b;
}
~Test()
{
}
Test(const Test &cmp)
{
this->a = cmp.a + 1;
this->b = cmp.b + 1;
}
public:
int Geta(){ return a; }
};
void F(Test obj)
{
cout<<obj.Geta();
}
void playobj()
{
Test d(1, 2);
Test F(d);
}
int main()
{
playobj();
system("pause");
return 0;
}