Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between pointer and reference?

Answer Posted / noopur sharma(m.c.a. r.u)

1)it is not necessary to intialize a pointer at the time of
declaration.like:int a=10; int *p=&a;
u can also do int a=10; int *p; p=&a;
but in the case of reference it is necessary to
intialize a ref.at the time of declaration.like: int
&a=10;bcoz ref.is the secondname(aliase)for an object.means
it always refere an object so it's necessary to initialize
it.
2)u can assign NULL to a pointer.like int *p=NULL; but u
can't assign NULL to a reference.like int
&P=NULL//incorrect.
3)u can create array to a pointer but u can't create
array to a ref.
4) u can use pointer to pointer.but u can't use ref.to ref.
5) pointer is a new variable that contain the address of
another variable.but ref. is a second name (aliase) of the
same variable.
6)to store pointer we require extra memory.but for
reference we don't require extra memory.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does visual c++ 2017 replace 2015?

938


What is the Use of the Developer Studio Editor?

2560


In which Way invoke context-sensitive help inside the editor?

2160


What is vcredist?

1101


How do I create an mfc application in vc++?

994


Explain some of commonly used methods provided by iunknown.

864


How do I fix microsoft visual c++ 2015 setup failed?

996


What is microsoft visual c++ 2010 x86 redistributable?

973


What is difference between c++ and visual c++?

968


What is microsoft visual c++ 2008 redistributable and do I need it?

963


How do I uninstall visual c++?

945


Difference between getmessage, postmessage & peakmessage.

977


How do I uninstall vc++ 2015?

866


What is visual c++ runtime error?

1144


Is it safe to uninstall microsoft visual c++ 2008 redistributable?

1024