CS202 6- ‹#›
Overloading >>, << Operators
nIt is tempting when overloading these operators to include prompts and formatting.
nThis should be avoided. Just imagine how awkward our programs would be if every time we read an int or a float the extraction operator would first display a prompt. It would be impossible for the prompt to be meaningful to all possible applications.
nPlus, what if the input was redirected from a file? Instead, the extraction operator should perform input consistent with the built-in types.
nWhen we read any type of data, prompts only occur if we explicitly write one out (e.g., cout <<"Please enter...").