returns (see its man page):
1. > 0: The number of items scanned successfully.
2. = 0: There is more input but the next character to be scanned doesn't match syntactically the first input type.
: Any error or end-of-file occurred.
So to get all input variables being well initialized you may better run a positive test of scanf(3)
If you want to get input into more than one variable from only one scanf(3)
expression, a positive test may be inevitable to avoid running out of sync with your input data stream.
: Using is.good() does only work well having initially synchronized both stdin method (C-stdio and C++-streaming) because they use different buffers for the same stream. See http://www.cplusplus.com/reference/ios/ios_base/sync_with_stdio/.
But mixing both methods usually makes sense only if you're using libraries which use another method than your preferred one.
: Posix stdio doesn't distinguish between console input or those from other files. There's also no <conio.h>
available nor needed when using Posix stdio. May be you need it to get those non-Posix getch()
function prototype? I've never seen it before.