please don't confuse the references and pointers.
Pointers and references are two distinct.
for a example the bellow code demonstrates swap function
with using pointers and references.
So using pointers you can change do the same thing.But using pointers is little bitCode:void swap(int&a , int& b) { int temp ; temp = a; a = b; b = temp ; } void swap(int *a , int *b) { int temp; temp = *a ; *a = *b; *b = temp ; }
dirty.



LinkBack URL
About LinkBacks




Reply With Quote
Like this post
Bookmarks