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++)