What is the difference between Pointer and a Reference?
When you would use them?

Answer Posted / man

Reference is alias of a variable i.e. a constant pointer
which reference to a variable and can not be NULL.
You can not can get the address of ref. They are used as a
variable.

Pointers are variale that hold address of variable and can
be NULL. And can point to any number of variable.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Should I learn c++ c?

607


What does the ios::ate argument do?

661


How java is different from c and c++?

637


What is the size of a vector?

575


How to access a variable of the structure?

583






Do you know the problem with overriding functions?

570


Out of fgets() and gets() which function is safe to use?

641


Why do we use iterators?

619


Can we declare a base-class destructor as virtual?

584


What is the advantage of c++ over c?

558


What is object oriented programming (oop)?

621


What is meant by the term name mangling in c++?

514


Define vptr.

594


Show the application of a dynamic array with the help of an example.

582


Explain mutable storage class specifier.

626