Why should I use fflush(stdin) in this program?
问题 I know that it is use to clean the keyboard buffer, but I don't understand when/why I need to use it or if I really need to. For example, into this code that I made for my class, it only works if I put fflush(stdin) into the main function right after the while , and I only know this because the professor told me to do so after I had showed him the erro. Does the problem have something related with the struct and thats why I should use fflush(stdin) ? Here is the code: #include <stdio.h>