Need some help with a function using pointers.

From my assignment:
Create a function "swapArray" which takes the array created above as parameter, and swaps first
half of the elements with second half of the elements. You must use pointers to perform this
operation. Print the array after swapping.
eg1: [ 1 23 11 200 50 ] -> [ 200 50 11 1 23 ]
eg2: [ 54 251 42 7 60 800 ] -> [7 60 800 54 251 42]

I have the array created and so far I am at this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
void showArray(int [], int);
int main()
{
	unsigned seed=time(0);
	srand(seed);
	//size  declaration of array
	const int SIZE=100;
	int array[SIZE];
	//random numbers assigned
	for(int i=0; i<=99; ++i)
		{
			array[i]=rand() %1000+1;
			cout<<array[i]<<" "<<endl;
		}
system("pause");
return 0;
}
//Array function
void showArray(int array[] , int size)
{
	   for (int count = 0; count < size; count++)
	          cout << array[count]<<" "<<endl;
	   cout << endl;
} 


I have the setup taken care of, I just have no idea how to go about creating the "swapArray" function.
Any help would be appreciated.
Find the middle pos of the array, then swap array at 0 with mid, at 1 with mid+1, ....
Topic archived. No new replies allowed.