对于下面定义的类Myclass,在函数f()中将对象成员n的值修改为50的语句应该是()
class Myclass
{
public: Myclass(int i){n=i;}
void SetNum(int x){n=x;}
private: int n;
};
int f()
{
Myclass *p=new Myclass(45);
___________________________________
}
A.正确答案Ap->SetNum(50)
B.SetNum(50)
C.p->n=50
D.*p->SetNum(50)