编译时多态运行时多态C++
时间: 2023-10-26 12:22:43 浏览: 123
C++编译期多态与运行期多态
在C++中,实现多态有两种方法:编译时的多态和运行时的多态编译时的多态也被称为静态多态或早绑定。它基于模板的具现化和函数的重载解析,这种多态在编译期进行。而运行时的多态也被称为动态多态,它是面向对象编程中的一种特性,它基于类的继承和虚函数的机制,在运行期间根据实际对象的类型来确定调用的函数。所以,编译时多态和运行时多态在C++中都是存在的。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [c++ 多态 运行时多态和编译时多态_码农子与多态的日常](https://blog.csdn.net/weixin_39811101/article/details/110313513)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [C++编译时多态和运行时多态](https://blog.csdn.net/TABE_/article/details/116865956)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [C++编译期多态与运行期多态](https://download.csdn.net/download/weixin_38658568/14911690)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文