What are default arguments in functions?
- C++ allows a function to assign a parameter a default value when no argument corresponding to that parameter is specified in a call to that function. The default value is specified in a manner syntactically similar to a variable initialization.
- For example, this declares MyFunction as taking one int argument with a default value of 0 :
Post a Comment