The two elements of a function are the argument and the return value.

It is easy to tell if a function with the same name has different arguments (including different types and orders).

If a function of the same name only has a different return value type, sometimes you can tell the difference, sometimes you can’t. Such as:

void Function(void);
int Function (void);

The first function returns no value, and the second function returns an int. Int x = Function (); int x = Function ();

You can determine that Function is the second Function. The problem is that in C++/C programs, we can ignore the return value of a function. In this case, neither the compiler nor the programmer knows which Function is being called. So overloaded functions can only be distinguished by their arguments, not by their return value types. The compiler generates a different internal identifier for each overloaded function based on its arguments.

void Function(void)
{};
int Function(void)
{};

Note: You cannot overload a function based only on its return value. You can overload a function based only on a different parameter list, including the number and type of arguments. The compiler will issue error warnings based solely on the return type of the argument, indicating errors at compile time