语句哪里错了#includeusing namespace std;class B{public:void setpoint(int x);int showpoint();private:int *point;};void B::setpoint(int x){*point=x;};int B::showpoint(){return *point;};int main(){B a;a.setpoint(44);cout
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/24 06:34:46
语句哪里错了#includeusing namespace std;class B{public:void setpoint(int x);int showpoint();private:int *point;};void B::setpoint(int x){*point=x;};int B::showpoint(){return *point;};int main(){B a;a.setpoint(44);cout
语句哪里错了
#include
using namespace std;
class B{
public:
void setpoint(int x);
int showpoint();
private:
int *point;
};
void B::setpoint(int x){*point=x;};
int B::showpoint(){return *point;};
int main(){
B a;
a.setpoint(44);
cout
语句哪里错了#includeusing namespace std;class B{public:void setpoint(int x);int showpoint();private:int *point;};void B::setpoint(int x){*point=x;};int B::showpoint(){return *point;};int main(){B a;a.setpoint(44);cout
#include<iostream>
using namespace std;
class B{
public:
void setpoint(int x);
int showpoint();
private:
int *point;
};
void B::setpoint(int x){point=new int(x);}//开辟内存空间
int B::showpoint(){return *point;};
int main(){
B a;
a.setpoint(44);
cout<<a.showpoint();
return 0;
}