course content

Course Content

Introduction to C++

Overloaded Function (Bonus)Overloaded Function (Bonus)

The C++ language allows you to create functions with the same name, but the arguments of such functions must be different. Such functions are called overloaded.

For example:

cpp

main.cpp

The functions have the same "func" name but different arguments. In our case:

  • When passing two arguments to a function, the function with two arguments will be called.
  • When passing one argument to a function, the function with one argument will be called.

Section 5.

Chapter 5