自考新教材-p145_6

源程序:

#include <iostream>
using namespace std;

class A
{
int a, b;
public:
A(int x = 0, int y = 0)
{
a = x;
b = y;
}
};
int main()
{
A *p;
p = new A(4,5);
system("pause");
return 1;
}

运行结果:

 

posted @ 2020-02-06 19:57  bobo哥  阅读(138)  评论(0编辑  收藏  举报