Where should the default values of the parameters be specified?

  • In a separate header file
  • In the function call
  • In the function declaration
  • In the function definition
Default values of parameters in C++ functions should be specified in the function definition, not in the declaration. This is where you provide the actual implementation of the function, including the default values for its parameters. The declaration merely informs the compiler about the function's signature.
Add your answer
Loading...

Leave a comment

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