<P> There is no means to know if the argument has been specified by the caller or if the default value was used . </P> <P> The above - mentioned method is especially useful when one wants to set default criteria so that the function can be called with or without parameters . Consider the following: </P> <P> The function call: </P> <P> will by default print "hello world!" to the standard output std:: cout (typically the screen). On the other hand, any object of type std:: ostream can now be passed to the same function and the function will print to the given stream instead of to the standard output . </P>

When do we need to use default argument in a function