hi all,
have been troubling people here these few days, im finishing my program soon and hope to get the documentation done by end of this week. I have tested my program and theres one last thing left to do,,, validating my yes and no option...i went thru the forum and couldnt get my program to validate Y/N, if i use strcmp, i will need to change to %s, is there anyway to add a code so that %c can be validate to y and n only, thank you all
Code:void add_rec(void) { char add_continue; char ans; add_continue = 'Y'; do { gotoxy(26,23); printf("Write to File (Y/N)?"); scanf("%c", &ans); fflush(stdin); if (toupper(ans) == 'Y'); { mem[count] = mem_temp; /*transfer temp data to array*/ ++count; } gotoxy(24,24); printf("Enter next record (Y/N)?"); scanf("%c", &add_continue); fflush(stdin); } while (toupper(add_continue) == 'Y'); }



LinkBack URL
About LinkBacks


