Does the array fine but when it does the function it wont work, if anyone can help that would be great!
#include <iostream>
using namespace std;
void reverse(int a[10], int size)
{
for (int j=0; j<size/2; j++) {
int temp = a[j];
a[j] = a[size-j-1];
a[size-j-1] = temp;
}
return;
}
int main()
{
int values;
int size;
int a[10];
for(size = 0; size < 10; size++)
{
cout << "Please input the a max of 10 numbers and then type 00(doubel zero) to stop: " << endl;
cin >> values;
if(values == 00)
{
cout << "You entered a double zero " << endl;
cout << "size of Array is " << size << endl << endl;
break;
}
a[size] = values;
}
cout << "Youve inputed the following numbers: " << endl;
for(int i = 0; i < size; i++)
{
cout << a[i] << "reverse of them: " << reverse(a[10], size) << endl;
}
return 0;
}