📄 ch11virtualshapes.cpp
字号:
//Program 13 Virtual Shapes Part1
// Ch11VirtualShapes.cpp
#include <iostream.h>
#include "Ch11VirtualShapes.h"
int main()
{
cout << "\n The Virtual Shapes Program " << endl;
Shape *ptr_to_base, MyShape;
Sphere MySphere;
Pyramid MyPyramid;
ptr_to_base = &MyShape; // base pointer points to Base class
ptr_to_base->WhatAmI();
ptr_to_base = &MySphere; // pointer now points to the Sphere
ptr_to_base->WhatAmI();
ptr_to_base = &MyPyramid; // pointer now points to the Pyramid
ptr_to_base->WhatAmI();
cout << "\n Ohhh This is hard! \n\n";
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -