文件名称:c
介绍说明--下载内容来自于网络,使用问题请自行百度
定义一个车(vehicle)基类,有Run、Stop等成员函数,由此派生出自行车(bicycle)类、汽车(motorcar)类,从bicycle和motorcar派生出摩托车(motorcycle)类,它们都有Run、Stop等成员函数。在main()函数中定义vehicle、bicycle、motorcar、motorcycle的对象,调用其Run()、Stop()函数,观察其执行情况。再分别用vehicle类型的指针来调用这几个对象的成员函数,看看能否成功;把Run、Stop定义为虚函数,再试试看。-The definition of a car (vehicle) base class, with Run, Stop and other member functions, thus derived a bike (bicycle), automobiles (motorcar) class, derived from the bicycle and motorcar motorcycle (motorcycle) class, they all Run , Stop and other member functions. In the main () function is defined in the vehicle, bicycle, motorcar, motorcycle object, call its Run (), Stop () function is to observe its implementation. Each with a pointer with the vehicle type to call the member functions of these objects to see if successful the Run, Stop is defined as virtual functions, try again.
相关搜索: vehicle
(系统自动生成,下载前可以参看下载内容)
下载文件列表
4355898_5515dab3d9.jpg
c.txt
c.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.