O'Reilly logo
  • Pawel Baczynski thinks this is interesting:

get_num.cpp

From

Cover of C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart, Third Edition

Note

Wouldn’t you find it convenient to have 0 (or whatever number you choose) as a default value? But how do you implement this behavior? This next example demonstrates how.