#include class base { Private:int x,y; public:void setxy(int a,int b){x=a;y=b;} void 分析下面程序的输出结果.#includeclass base{Private:int x,y;public:void setxy(int a,int b){x=a;y=b;}void show(base *p){cout
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/27 13:36:59
#include class base { Private:int x,y; public:void setxy(int a,int b){x=a;y=b;} void 分析下面程序的输出结果.#includeclass base{Private:int x,y;public:void setxy(int a,int b){x=a;y=b;}void show(base *p){cout
#include class base { Private:int x,y; public:void setxy(int a,int b){x=a;y=b;} void
分析下面程序的输出结果.
#include
class base
{
Private:
int x,y;
public:
void setxy(int a,int b){x=a;y=b;}
void show(base *p)
{cout
#include class base { Private:int x,y; public:void setxy(int a,int b){x=a;y=b;} void 分析下面程序的输出结果.#includeclass base{Private:int x,y;public:void setxy(int a,int b){x=a;y=b;}void show(base *p){cout
输出结果:
25,39
在类的内部是可以访问私有变量或者函数的!
完整的程序是:
#include//不是iostream.h
using namespace std;
class base
{
private:
int x,y;
public:
void setxy(int a,int b){x=a;y=b;}
void show(base *p)
{
cout