I need a generic piece of advise. While coding FORGETPW, it’s troubling me to read individual character at the end of a line using scanf("%c"). scanf() is leaving ‘\n’ unconsumed. To eat it up, I am using a dummy scanf(). Don’t know the approach is elegant or not.But, for files created on Windows and Linux, it won’t work transparently because of different line-ending characters. The code is not portable.
Shall I assume the automated test being done on an input file created in Linux? Is there a better way to handle this situation?