+ 2
Why we use pointer in swapping??
We can swap without pointer but still we use pointer why???
4 Respuestas
+ 1
Pointer are used when the values are passed to function and then swapped.
Or normal swapping can be done.
+ 7
There is no particular reason to do swapping with pointers. You can also pass by reference to functions for swapping purposes. Pointers are simply there as an alternative method for stuff.
+ 2
References are hidden pointers, when I said pointers, I included references ^^'
+ 1
We can swap without pointer if you do not create a function. With a function you must (at least to do it properly).