problems with prototype function looping
hey guys im learning to make my own functions and iv had a little trouble it seems my function is returning what i want but for some reason when i put it in a do while loop it just keeps looping instead of exiting when i want, you should be able to see what i mean from this sample text. Thanks in advance much appreciated the people on this site are so helpful.
for some reason it just keeps looping even if something other than y or Y is entered.
const int TRUE = 1;
const int FALSE = 0;
int isY(char ch);
int x = 1;
while (x = 1)
choice = isY(choice);
if (choice == FALSE)
int isY(char ch)
printf("Say this massage again\n(Y/N)? ");
if ( (ch == 'y') || (ch == 'Y') )
result = TRUE;
result = FALSE;
p.s. fflush(stdin) works fine on my compiler (quincy 2005) and i have not yet been tought a better way to flush the standard input thing, but that should not be the problem here. thanks again