__fpurge? Usa fflush. NB: fflush(stdin) è comporta un undefined behavior.
An implementation shall not predefine the main function. This function shall not be overloaded. It shall have a return type of type int, but otherwise its type is implementation-defined. All implementations shall allow both the following definitions of main: int main()and int main(int argc, char* argv[])