Assuming you have the rest of the code right this should work. You made a few mistakes like you forgot to put the '[i]' after myList and I don't know why you put the first line in. It seems unnecessary. Try it like this:
1 2 3 4 5 6
int myList[10];
for (int i = 1; i <= 10; i++)
cin >> myList[i];
for (int i = 1; i <= 10; i++)
cout << myList[i] << " ";
cout << endl;
When you say you don't know how to run this code do you mean you don't have a compiler?
using namespace std;
int main ()
{
int myList[10];
for (int i = 1; i <= 10; i++)
cin >> myList[i];
for (int i = 1; i <= 10; i++)
cout << myList[i] << " ";
cout << endl;
const size_t arr_size =10;
int int_arr[arr_size]; // array of 10 ints
int_arr[0] = 1; // The first element in the array
int_arr[arr_size -1] = 10; // the last element in the array
for(size_t index = 0; index < arr_size; index++)
{
int_arr[index] = 1;
}
Oh yes, sorry I din't see that. Grey Wolf and Athar are very true. Also it is very bad practice to use system("pause"). A simple alternative, I find, is to