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

What is a rooted hierarchy?

874


Is overriding possible in c++?

763


What does ios :: app do in c++?

772


What does new do in c++?

819


What is extern c++?

716


What is static in c++?

796


Explain stack & heap objects?

816


What is the syntax for a for loop?

801


Define friend function.

776


How should runtime errors be handled in c++?

837


How many keywords are used in c++?

766


Describe the syntax of single inheritance in C++?

843


What is runtime polymorphism in c++?

823


Where and why do I have to put the "template" and "typename" keywords?

784


What do you mean by “this” pointer?

795