Re: mainMenu keeps on appearing at the end of every option
David Harmon <source@netcom.com> writes:
Yuck!
The actual reason for ?Yuck!? should be that the code was
not /trimmed down/ to the smallest possible program showing
the problem (to an SSCCE).
Another ?Yuck!? for one poster who quoted all this code to
add a single line hidden somewhere.
Another ?Yuck!? possibly for lack of ideas how to debug
one's code. But for beginners this lack of debugging
capabilities is acceptable, because when one is still
learning, one does not have to know everything.
Do not use setw() for no reason whatsoever.
Why not use setw to set a width, if this should be required?
Do not use endl when "\n" will do
Recently I read someone who recommended to always use
?::std::endl?, because this will make the last output
visible should the program crash before the next other
flushing operation, so it should help debugging.
Do not use many operator<< when all you need is one.
cout << "\n"
"* * - - - - - - - - - - - - - - - - - - - - - - - * *\n"
"* *\n"
"| ###### ###### ###### ##### |\n"
"| # # # # |\n"
"| ###### ###### # ### # |\n"
Or even: ::std::cout << R("
* * - - - - - - - - - - - - - - - - - - - - - - - * *
* *
| ###### ###### ###### ##### |
| # # # # |
| ###### ###### # ### # |
....
However, when preparing an SSCCE, all of this ?* * - - ...?
would be omitted anyways.