c++多态包括那些概念
时间: 2023-10-26 13:01:18 浏览: 134
多态的概念包括静态多态和动态多态。静态多态发生在编译时,通过函数重载实现,即同一个函数名,但参数类型或个数不同,根据不同的参数类型或个数来调用相应的函数。静态多态可以提供更好的代码复用性和可读性。动态多态发生在运行时,通过父类的指针或引用来调用不同对象的虚函数,根据对象的实际类型来动态确定调用哪个类的虚函数。动态多态可以实现运行时的灵活性和扩展性。因此,多态的概念包括了静态多态和动态多态。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [C++多态的概念与使用(详细介绍)](https://blog.csdn.net/jiaao666/article/details/124014731)[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_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [c++ 多态详解](https://blog.csdn.net/qq_51579696/article/details/124542105)[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_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文