64,683
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
class point {
private: int n;
public:
void setn(int m){n=m;}
void static funp(point &pth);
};
void point::funp(point &pth)
{
cout << pth.n << endl; }
int main()
{
point t;
t.setn(10);
point::funp(t);
return 0;
}
class point
{
private:
int n;
public:
void funp(point &pth);
};
void point::funp(point &pth)
{
cout << pth.n << endl;
}
int main()
{
point t;
t.n = 10;
point::funp(t);
return 0;
}