源程序:
#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;}
运行结果: