In C++, if two overloaded functions have the same signature but differ in const qualification, it leads to ________.

  • Ambiguity Error
  • Compilation Error
  • Linker Error
  • Undefined Behavior
When two overloaded functions in C++ have the same signature but differ in const qualification, it leads to undefined behavior. The compiler cannot determine which function to call, resulting in ambiguous code. It's essential to avoid such situations for code clarity and reliability.
Add your answer
Loading...

Leave a comment

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