I have a disagreement with people from work, they say if you pass a pointer to a pointer, that is pass by value. But it is obviously pass by reference, not? I want to learn.
Please look at this signature which is the example:
They say it's pass by value! I explained like below which I think is enough but they refuse understand; please give a honest view if the following explanation is correct:Code:void doSomething(std::string** ppStr)
This is not only pass by reference, it is the very truthful pass by reference, more thruthful than pass by reference using its reference type.Code:void doSomething(std::string** ppStr)
The most truthfull pass by reference, the one that can null the referenced, is pass by address, the signature would be pass by pointer, what's passed is an address.
Pass pointer to pointer is exactly pass by address, so it is pass by reference in the most extreme sense.