Scanf() is bad because if you use it to directly get user input, and the user types in something different than scanf() is expecting, it screws up. A better scheme is to store user input in an intermediate buffer and sscanf() the buffer.