main(){
int *p;
f1(&p)
}
f1(**p){
f2(&p);//If I've to pass the pointer by reference again in another function, will I've to do something like this?
}
f2(***p){
**p = NULL;
}
In http://codepad.org/r9ud4Qsm same purpose is being solved but my question is: why in the definition of f1 (in my codepad.org code) p's address has not been passed and still it's passed by reference?
In order to pass a pointer by reference we must have to pass its address in the arguments of a function but in your case, I can't understand how it's passed by reference (though I'm sure that it's passed by reference).
In order to pass a pointer by reference we must have to pass its address
No, that's not what pass-by-reference means. You're describing creating a new pointer and passing the new pointer by value (which is a common C programming technique, but the codepad.org link implies you're talking about C++)