Default arguments should be avoided in virtual functions as they don’t behave as most people expect and can lead to ________.

  • Code Reuse
  • Improved Debugging
  • Increased Performance
  • Runtime Errors
Default arguments in virtual functions can lead to runtime errors because the default argument values are determined at compile-time, not runtime. This can result in unexpected behavior when overriding virtual functions in derived classes.
Add your answer
Loading...

Leave a comment

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