Computer Science, asked by srchethan9000, 11 months ago

How call by reference differs from call by pointer with an example?

Answers

Answered by Pramodkumarhani
4

Call by reference and call by pointer do the exact same thing, ideally.

The only difference between them is the fact that a pointer can be null, or maybe pointing to invalid places in memory, while references are never null. Also, a pointer can be re-assigned while reference cannot be, and must be assigned at initialization only. So, the rule of thumb being — use references when you can, and pointers when you have to.

Similar questions