I have basically a cube with numbers 1-6 (for monopoly for example) stored in
vector<vector<short> > cube;
it looks like this:
0300
5126
0400
I have code for rotating it upside:
short tmp=cube[0][1];
cube[0][1]=cube[1][1];
cube[1][1]=cube[2][1];
cube[2][1]=tmp;
My question is how can i create function from that code with pointers or something simmilar so I dont have to copy that vector to function, but just change existing vector? Something like:
void rotateCubeUp(vector<vector<short> >cube){
short tmp=cube[0][1];
cube[0][1]=cube[1][1];
cube[1][1]=cube[2][1];
cube[2][1]=tmp;
}
But this is without pointers.