You need to pass the pointers by reference, otherwise you'd only be changing them inside the function.
void swap(char *&a, char *&b)
http://www.cplusplus.com/doc/tutorial/functions2/
Also, you need to have those as
const char *
because they point to constant characters (string literals)
Last edited on
Thank's, I thought that pass by reference was only used with "regular" variables.
Pointers are 'regular' variables. In fact, I can't really think of any variables or classes that aren't 'regular'.