169 views
Is call by address in C same to call by reference in C++? if not then whats basic difference ?? and why doesn't C have a refernce variable just like C++??
edited | 169 views
Out of GATE 2017 syllabus , right ?
C programming is there in gate 2017 i was studying that so i got a question so i asked :)
@Gabbar  thanks a lot but what is the ans of this question Is call by address in C same to call by reference in C++?

1. A pointer can be re-assigned any number of times while a reference can not be re-seated after binding.
2. Pointers can point nowhere (NULL), whereas reference always refer to an object.
3. You can't take the address of a reference like you can with pointers.
4. There's no "reference arithmetics" (but you can take the address of an object pointed by a reference and do pointer arithmetics on it as in &obj + 5).
5. you can have pointers to pointers to pointers offering extra levels of indirection. Whereas references only offer one level of indirection.
6. A pointer is a variable that holds a memory address. Regardless of how a reference is implemented, a reference has the same memory address as the item it references.
selected

+1 vote
1
2