?? 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 + -