arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1405.1302cs.PL
收藏

C++中函数重载与函数覆盖的比较研究

Comparative Study of the Function Overloading and Function Overriding Using C++

Brijender kahanwal

摘要:

在面向对象程序设计系统(OOPS)中,函数重载和函数覆盖这两个概念对程序员来说有点混乱。本文试图消除这种混淆。这两个概念都属于多态(polymorphism)(poly指多个,morph指形式)。本文对它们进行了比较。对于新的程序员和学习者来说,理解它们是很重要的。函数重载[1]是在编译时实现的,而函数重写是在运行时间实现的。函数重写总是发生在继承中,但函数重载也可以在没有继承的情况下发生。

英文摘要:

In the Object-Oriented Programming Systems (OOPS), these two concepts namely function overloading and function overriding are a bit confusing to the programmers. In this article this confusion is tried to be removed. Both of these are the concepts which come under the polymorphism (poly means many and morph mean forms). In the article the comparison is done in between them. For the new programmers and the learners, it is important to understand them. The function overloading [1] is achieved at the time of the compile and the function overriding is achieved at the run time. The function overriding always takes place in inheritance, but the function overloading can also take place without inheritance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑