Give an example to illustrate the use of default values.
istream::getline() behaves differently depending on what arguments are passed. Specifically, if you pass a third argument, that character becomes what the function looks for in order to stop reading. I recommend you read the manual about it.
One way to implement all of these behaviors is to use default values in the implementation:
Code:
istream& getline (char* s, streamsize n, char delim = '\n');
Another reason to use default values is if you are already using a function, but need to add more features. By using default values, you are not breaking code where the function was called the original way.
Does it make compiling more efficient? Does it make the object code shorter?
There is no real evidence it does any of these things... but if you use default values instead of function overloads, you will have implemented one less function - so the object code is smaller. If you ask me, using this as a reason for a design is missing the point. The good reasons are things I mentioned earlier in this post.