Skip to main content

Timeline for Simple Temperature Converter 2 in C

Current License: CC BY-SA 3.0

4 events
when toggle format what by license comment
Aug 29, 2016 at 17:26 comment added chux " unsure what is better, exit the program or call again. " -> Neither. Better to consume the offending non-numeric input then solicit input again or return with an indication to that effect. Should error/end-of-file occur, return a value to indicate that. "better to work with the provided code rather than complete new one?" --> When OP code is weak/faulty, better to use improved code.
Aug 29, 2016 at 17:18 comment added miscco Yeah, the == is indeed missing. Regarding the infinite recursioni am unsure what is better, exit the program or call again. Or would you count to N until you stop? Regarding the other stuff I am new here and dont know whether it is appropriate to just copy the original code. I wouldnt have written it that way on my own but in my opinion it is better to work with the provided code rather than complete new one?!
Aug 29, 2016 at 16:52 comment added chux 1) || option OFF certainly should be || option == OFF 2) This get_option() may be an infinite recursion should user enter a non-numeric. 3) Using option without qualifying the result of scanf_s() is not robust programming. 4) printf("Option: "); on buffered output lacks certainty it will display before user input is requested. Better to fflush(stdout); before seeking user input. 5) Inconsistent coding in initialize of float input_temp = 0;, yet not int option;
Aug 29, 2016 at 8:05 history answered miscco CC BY-SA 3.0