Short version: I wrote a program using C. A
while loop rejects invalid input. Chaining bad input the right way creates a
printf infinite loop.
Hello! After using my laser printer with Libreoffice under Linux I found that there was a speed penalty when printing on both sides of the paper using the all-odd, reverse-all-even method.
I had to write the page numbers one by one. This software improves that to two pairs of copy-paste.
I always try to think in ways to catch unexpected input/behaviour. Ironically that’s the part that’s preventing everything else from working without issues.
The first part of my program makes sure that the user has provided a positive number as input, discarding letters and asking again for input in case of negatives or zero. The problem is, providing a negative and then characters are a super combo finish, printing the intended warnings forever after unless halted.
Thanks for reading all this.
Do you know what’s wrong with my program?