for ex. lets say I have the code:
Code:
printf("\nEnter a number");
scanf("%d*c*");
I want it to keep asking that over and over until someone presses a specific character to quit out.
So it would say
Enter a number:
then you put in a # and after the # is entered it repeats again
Enter a number:
and the only way it exits out is if you type in something specific like 'X'.
I think that can be done with a while loop
Code:
int n;
printf("\nEnter a number");
scanf("%d*c*",&n);
while (n = 'X')
{
//code here that returns me to the main menu
}
I am not very good with arrays but I want to store all the input into an array. .