C++语言程序设计中多态问题分析  

Analysis of polymorphism in C++ programming

在线阅读下载全文

作  者:李欣然[1] 赵山林[1] Li Xinran Zhao Shanlin(North University of China, College of Computer and Control Engineering, Taiyuan, Shanxi 030051, China)

机构地区:[1]中北大学计算机与控制工程学院,山西太原030051

出  处:《计算机时代》2017年第2期57-59,共3页Computer Era

摘  要:C++语言程序设计课程中,多态性分为两类。一是静态多态,通过函数重载实现,解决自定义数据类型运算问题;二是动态多态,通过虚函数实现,提高了程序的可扩充性。通过实例分析出利用函数重载实现静态多态的方法以及利用虚函数产生动态多态的条件。In the course of C ++ Programming, there are two kinds of polymorphisms. One is static polymorphism which is implemented through function overloading to solve the custom data types operations; the other is dynamic polymorphism which is implemented through virtual function to improve the scalability of the program. In this paper, examples are used to analyze the method of using function overloading to implement static polymorphism and the conditions of using virtual function to produce dynamic polymorphism.

关 键 词:C++语言程序设计 静态多态 动态多态 虚函数 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象