正在加载图片...
上海交通大学交大密西根 联合学院·一 ◆] 181 UM-SJTU Joint Institute University of Michigan Shanghal Jiao Tong University class Definition (AddIntConsoleT.h) class AddIntConsoleT:public ConsoleT public: void disp (int intSum){ printLine (int1,"+"int2,"="intSum,endD); When you define a class to be a subclass of another one, it inherits all the data and functions of the other one. printLine is defined in ConsoleT and could be used in AddIntConsoleT just like it is defined in t.class AddIntConsoleT : public ConsoleT { // member data defined here // member function defined here }; class Definition ( Definition (AddIntConsole ConsoleT.h) class AddIntConsoleT: public ConsoleT { public: void disp (int intSum) { printLine (int1, " + ", int2, " = ", intSum, endl); } }; When you define a class to be a subclass of another one, it inherits all the data and functions of the other one. printLine () is defined in ConsoleT and could be used in AddIntConsoleT just like it is defined in t
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有