![]() |
#2
sunny孙2013-09-24 16:45
|
#include<iostream>
using namespace std;
class Test
{
public:
int *p;
Test(int value)
{
p =new int(value);
}
~Test()
{
delete p;
p=NULL;
}
void PrintValue()
{
cout<<"The value is "<<*p<<endl;
}
};
void Func(Test t)
{
cout<<"the func"<<endl;
}
int main()
{
Test t1=33;
Func(t1);
t1.PrintValue();
return 0;
}
编译能通过,结果有问题!