there are a handful of problems so far, like the multiple declarations and missuses of the variable 'x'; the for loop probably shouldn't be using x since it is already defined and x shouldn't be an array size when it is uninitialized.
as for what you want to get done it's kind of hard to tell but I think I can help.
int main()
{
const int ARRAY_SIZE = 1000; //initialize so it doesn't end up being either 0 or literally anything
int myArray[ ARRAY_SIZE ];
for( int x = 0; x < ARRAY_SIZE; x++ )
{
cin >> myArray[ x ];
}
return 0;
}
now this will cycle through 1000 times asking for a numeral input until the array is written and full, if you want to be able to stop the array you'll have to add a way to break the for loop and record where it stopped.
int main()
{
const int ARRAY_SIZE = 1000;
int myArray[ ARRAY_SIZE ];
int arrayEnd = 0;
for( int x = 0; x < ARRAY_SIZE; x++ )
{
int inputBuffer = 0; // this variable saves the users input and checks to see if the user wants to exit before saving the variable to myArray.
cin >> inputBuffer;
if( inputBuffer != -1 ) // -1 is just a value the user enters to stop the loop, choose any number you want for this.
{
myArray[ x ] = inputBuffer;
}
else
{
arrayEnd = x;
break; // stops the for loop if the number above is entered.
}
}
if( arrayEnd == 0 )
{
arrayEnd = ARRAY_SIZE;
}
return 0;
}
if you want truely unlimited or a more malleable array of integers you can new an array of ints to set the size of the array like so
int main()
{
int* myArray = nullptr;
int arraySize = 0;
cin >> arraySize;
myArray = new int[ arraySize ];
for( int x = 0; x < arraySize; x++ )
{
cin >> myArray[ x ];
}
delete[] myArray;
return 0;
}
but I wouldn't recommend using new if you don't have most of the basics down since new can easily lead to memory leaks and more little things to keep track of.