Question about Arrays

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()
{
	const int 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.
It's incredibly difficult to do what you're trying to do with plain arrays - I recommend using std::vector.
http://www.cplusplus.com/reference/vector/vector/
Ok I will look into it. Thanks for your advice.
Topic archived. No new replies allowed.