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
What is a rooted hierarchy?
Is overriding possible in c++?
What does ios :: app do in c++?
What does new do in c++?
What is extern c++?
What is static in c++?
Explain stack & heap objects?
What is the syntax for a for loop?
Define friend function.
How should runtime errors be handled in c++?
How many keywords are used in c++?
Describe the syntax of single inheritance in C++?
What is runtime polymorphism in c++?
Where and why do I have to put the "template" and "typename" keywords?
What do you mean by “this” pointer?