Hi everybody. I have a question regarding the use of arrays. I would like to create an array where the users input numbers until a certain character is input. For example, the array would take numbers until the user types "x" or another character. I have written some code for just a small group of numbers. The code I have written so far is:
1 2 3 4 5 6 7 8 9 10 11
int main()
{
constint NUMBERS = 3;
int array[NUMBERS];
char fail = 'n'for (i = 0; i < NUMBERS; i++)
cout<<"Input 4 numbers "<<endl;
cin>>array[i];
}
I don't know how to create the condition using the char to end the input of numbers. Any help is appreciated. Thank you.