I want to know the disadvantages of scanf().
In many sites, I have read that using scanf might cause buffer overflows. What is the reason f
Problems I have with the *scanf() family:
printf(), you can't make it an argument in the scanf() call; it must be hardcoded in the conversion specifier.scanf("%d", &value); will successfully convert and assign 12 to value, leaving the "w4" stuck in the input stream to foul up a future read. Ideally the entire input string should be rejected, but scanf() doesn't give you an easy mechanism to do that. If you know your input is always going to be well-formed with fixed-length strings and numerical values that don't flirt with overflow, then scanf() is a great tool. If you're dealing with interactive input or input that isn't guaranteed to be well-formed, then use something else.