Quickly made this before heading out
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
void rotate(int* a, int* b, int* c, int* d);
int main()
{
int w = 7;
int x = 8;
int y = 9;
int z = 10;
cout<<"w: "<<w<<"\nx: "<<x<<"\ny: "<<y<<"\nz: "<<z<<endl;
rotate(&w, &x, &y, &z);
cout<<"After rotate\n";
cout<<"w: "<<w<<"\nx: "<<x<<"\ny: "<<y<<"\nz: "<<z<<endl;
cin.get();
cin.get();
return 0;
}
void rotate(int* a, int* b, int* c, int* d)
{
int temp = *a;
*a = *b;
*b = *c;
*c = *d;
*d = temp;
}
Output
w: 7
x: 8
y: 9
z: 10
After rotate
w: 8
x: 9
y: 10
z: 7
This what it should be?