自考新教材-p87_3

源程序:

#include <iostream>
using namespace std;
class A
{
public:
int a, b;
private:
int c, d;
public:
int getc();
};
int A::getc()
{
return c;
}
int main()
{
A onea;
cout << "onea.a" << "," << onea.getc() << endl;
system("pause");
return 1;
}

运行结果:

 

posted @ 2020-02-06 14:50  bobo哥  阅读(141)  评论(0编辑  收藏  举报