PDA

View Full Version : message


Xiang
05-04-2003, 10:02 AM
Dear sir,

Refers to the below coding. Why my error message can't be displayed, while user leave the 'Gender' field blank.

printf("Enter your gender [F/M]");
do {
gotoxy(25,14); fflush(stdin); scanf("%c", &gender);

if (gender == ' ')
{
gotoxy(10,25); textcolor(LIGHTRED);
cprintf("Do not leave the 'Gender' field blank!"); /* error message */
getch();
/* clear end of line at col 10, row 15 */
gotoxy(10,25); clreol();
}
}while (gender == ' ');

Thanks

Xiang