How does C++ distinguish between overloaded functions at compile time?

  • By considering the function name and parameter types
  • By considering the order in which functions are defined
  • By considering the return type
  • By using a random process
C++ distinguishes between overloaded functions at compile time primarily by considering the function name and the parameter types. The return type is not used for this purpose. This is known as compile-time or static polymorphism.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *