I am learning c++ and I have a function like so...
void int_swap(int *n, int *m){
int temp;
temp = *n;
*n = *m;
*m = temp;
}
I just want it to swap 2 ints. this is purely a learning exercise.
It works fine. I am just wondering of there is a better way to do this for objects of larger types. Can it be done without creating a temp?