作业帮 > 综合 > 作业

#include class base { Private:int x,y; public:void setxy(int

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/21 06:26:30
#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
输出结果:
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