📄 parent_son.cc
字号:
#include "stdio.h"class parent {public: parent() { index_ = 999;}protected: int index_;};class son : public parent {public: son() { index_ = 303;} int get_index() { return index_; }};int main() {// son *son_;// printf("The index_ of son pointer is %d\n", son_->get_index()); son *son_entity = new son(); printf("The index_ of son entity is %d\n", son_entity->get_index()); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -