I always thought that pointers are always passed by reference in c++.
Obj* a=0;
Init(a);
In the implementation of init I initialize the object. But when the function call is finished the pointer a was still null.
So I had to pass the pointer by reference. So the passing was same but I changed the function declaration to
Init(obj*&)
And now it works.
So my questions is what things are by default passed by reference in c++?
Edit: here is the answer that confused me. The guy is passing a char array pointer and that pointer is changed upon return https://stackoverflow.com/a/8032233