I am trying to get user input for any ten numbers and then to print them in reverse order below is my code it executes and gives me result but I am not able to get user input... please help me..
#include<iostream>
int*ReverseArray(int*orig,unsigned short int b)
{
unsigned short int a=0;
int swap;
for(a;a<--b;a++)
{
swap=orig[a];
orig[a]=orig[b];
orig[b]=swap;
}
return orig;
}
int main()
{
const unsigned short int SIZE=10;
int ARRAY[SIZE]={1,2,3,4,5,6,7,8,9,10};
int*arr=ARRAY;
for(int i=0;i<SIZE;i++)
{
std::cout<<arr[i]<<' ';
}
std::cout<<std::endl;
arr=ReverseArray(arr,SIZE);
for(int i=0;i<SIZE;i++)
{
std::cout<<arr[i]<<' ';
}
std::cout<<std::endl;
std::cin.get();
return 0;
}