Why was function overloading added to C++?

前端 未结 6 2010
囚心锁ツ
囚心锁ツ 2021-02-03 21:03

I have a C background. I was just wondering why was function overloading added to C++? C doesn\'t have function overloading but C++ does, what was the need for it?

What

6条回答
  •  忘掉有多难
    2021-02-03 21:27

    Using polymorphism , we can design a family of functions with same function name but with different argument list . The function would perform different operations depending on the arguments list in the function call.

提交回复
热议问题