728x90
fflush 대신에 아래를 사용.
void flushstdbin()
{
int ch;
do ch = getchar();
while (ch != EOF && ch != '\n');
}
char* fgetsclean(char *string)
{
if (string[strlen(string) - 1] == '\n')
string[strlen(string) - 1] = '\0';
else flushstdbin();
return string;
}