I got the first part of my code from my teacher, its how the function should be done, I am just have trouble with what to put for my cin statments as, none of them work. Please help.
#include <iostream>
using namespace std;
void reverse(int* a, int n)
{
int* head = a; // pointer to first element
int* tail = a+n-1; // pointer to last element
while (head < tail)
{
int temp = *head;
*head = *tail;
*tail = temp;
head++;
tail--;
}
return;
}
int main()
{
int n;
int a;
cin >> a;
cin >> n;
cout << reverse(a,n);
return 0;
}