I can't seem to figure this out: What happens in the first loop, I understand the second loop, but it takes in the array and then assigns it to another array or what? And is it multiplying the array by 2 to make it an array of 10?
#include<iostream>
using namespace std;
const int max=5;
int main()
{
int i;
int array[max*2];
for(i=0;i<max;i++)
{
cin >> array[2*i] >> array[2*i+1];
}
for(int j=max;j>0;j--)
{
cout << *(array+j);
}
return 0;
}
#include<iostream>
using namespace std;
const int max=5;
int main()
{
int i;
int array[max*2];
for(i=0;i<max;i++)
{
cin >> array[2*i] >> array[2*i+1];
}
for(int j=max;j>0;j--)
{
cout << *(array+j);
}
return 0;
}