+ 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
6 Answers
+ 12
" A pointer is a variable whose value is the address of another variable. Like any variable or constant, you must declare a pointer before you can work with it. "
https://en.m.wikipedia.org/wiki/Pointer_(computer_programming)
https://www.tutorialspoint.com/cplusplus/cpp_pointers.html
http://alumni.cs.ucr.edu/~pdiloren/C++_Pointers/
https://www.programiz.com/cpp-programming/pointers
https://www.sololearn.com/Discuss/487357/why-are-the-pointers-explained-so-difficultand-why-did-no-one-even-bother-to-include-a-real-example
https://www.sololearn.com/Discuss/720252/how-are-the-pointers-usefull
https://www.sololearn.com/discuss/199279/?ref=app
https://www.sololearn.com/discuss/84131/?ref=app
https://www.sololearn.com/discuss/115824/?ref=app
https://www.sololearn.com/discuss/132932/?ref=app
https://www.sololearn.com/discuss/658458/?ref=app
https://code.sololearn.com/cYMyee6yk4ps/?ref=app
https://code.sololearn.com/c7mW3DQoz3m0/?ref=app
https://code.sololearn.com/c4mzxhgpN8BC/?ref=app
+ 11
Thanks for make it clear
+ 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.
0
To manipulate the data in a variable we use pointers