I don't know if this is OS-related or not. I'm compiling with DJGPP on a machine that is running WinME. Here is the code:
Code:
 do {
	gotoxy(24,7);
	cscanf(" %u",&type);
	fflush(stdin);
	if (type <= 0 || type >= 8)
	{
		gotoxy(24,7);
		clreol();
		gotoxy(23,9);
		textcolor(RED);
		cprintf("ERROR! Please enter from menu");
	}
	else 
		return type;
}
while (type != 0);
Now whenever I run this loop.. it won't allow me to re-input the value that is stored at type. The value is a single digit. It just keeps going through the loop until I break and exit the program manually.

Also if i change the while condition to while (type == 0); it doesn't go through the loop and continues on with the problem. Any help is grateful. I've been pulling my hair out last night trying to fix it, but to no avail.