Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Pointer (Pass By Reference) Question

Tags:

c++

A pointer that is passed-in-by-reference. Why? aren't pointers just references anyways? What's really happening to this parameter?

void someFunc(MyPtr*& Object)
{

}
like image 696
RoR Avatar asked Jan 07 '11 08:01

RoR


1 Answers

Simply speaking, it gives you the ability to change the pointer itself: it can be changed to point to another location in the function. And the change will be reflected outside.

like image 175
LLS Avatar answered Oct 02 '22 14:10

LLS