Hello, I'm currently attempting to make a simple check which instantly reads a character which is inputted and acts upon it. The character is either "y" or "Y". And this is essentially for a very basic do-while loop for the full main function. Here's the code I'm using:
Character Check Function:
Code:
int goAgain(void) {
char check;
printf ("Would you like to go again? [Y/y to redo]: ");
scanf ("%c",&check);
if ((check == 'Y') || (check == 'y')) { system("CLS"); return 1; }
else return 0;
}
Main Function:
Code:
void main (void) {
do {
srand(time(NULL));
populateArray();
printf ("Minimum value in array is %d",findMinimum());
findValue();
} while (goAgain() == 1);
getch();
}
Any other details you may have noticed that might help my program are more than welcome =]
Lupo.