Code:
/*printf("\n Please enter the ticket number\n ");
fgets(day.t_no,7,stdin);
for(loop=0;loop<strlen(day.t_no);loop++)
{
if(!isdigit(day.t_no[loop]))
{
printf("\n Error non numerical ticket number! Try again.\n");
fgets(day.t_no,7,stdin);
}
} */
day.t_no is a array 8 characters long and part of a structure
this is the bit code that is giving me problems. when the program gets to this bit it asks for the ticket number and then immediatly displays the error message. the program worked perfectly when i was using a long integer to store the ticket number but then i changed it to a string to allow me to validate it and if possible to allow the user to change his input before enter is pressed.