Default Argument Function in C++

C++ allows us to call a function with out specifying all its arguments. In such cases, the function assigns a default value to the parameter which does not have a matching arguments in the function call. Default values are specified when the function is declared .The compiler looks at the prototype to see how many arguments a function uses and alerts the program for possible default values. Example: The function moveTo() can then be called with or without one or two arguments. One important point to note is that only…

Read More