+ 13

[DUPLICATE] What is the use of pointer?

learning In C++ i am confused about the pointers and its syntax...can anyone tell what is its advantage in real program

22nd Sep 2017, 1:59 PM
Abhishek Pun
Abhishek Pun - avatar
6 Answers
+ 11
Thanks for make it clear
22nd Sep 2017, 4:10 PM
Abhishek Pun
Abhishek Pun - avatar
+ 3
Pointer is a variable which contains the address in memory location of another variable... we can have a pointer to any variable. To declare pointer to a variable: int * pointer; Also we must associate a pointer to a particular type...you can't assign the address of a short int to a long int ,for instance. Advantages of pointer are:- a) pointers are more efficient in handling array and structure. b)it reduces length of program and it's execution time c)it allows c to support dynamic memory management d)pointer allows reference to function and thereby helps in passing of functions as arguments to other function.
1st Oct 2017, 4:34 PM
Prabhat Thakur
Prabhat Thakur - avatar
0
To manipulate the data in a variable we use pointers
2nd Oct 2017, 4:19 AM
Tanuja
Tanuja - avatar