have a queston that is confusing me....ok say we want to pass a call to a function by refence or a pointer....like this
Code:void squarebyRefernce( int &numberRef ) { nuberRef *= numberRef; } //or this void squraebyReference( int *nPtr ) { *nPtr = *nPtr * *nPtr; }
My question is...what is the difference... and why would you chose one over the other?
From what i gather they both do the same thing.