相关代码 |
|
#include class base { protected: int i; public: base(int x) { i=x; cout } ~base(void) {cout }; class derived : public base { int j; public: // derived uses x; base uses y. derived(int x, int y): base(y) { j=x; cout } ~derived(void) {cout void show(void) {cout }; void main(void) { derived object(3,4); object.show(); // Displays 4, 3 }
相关资源 |
|