20 20 10 20
What is application of above?
Consider a situation where we pass a pointer to a function and we want the function to modify the pointer to point to something else and we want these changes to reflect in caller. For example, writing a linked list function that changes head of it, we pass reference to pointer to head so that the function can change the head (An alternative is to return the head). We can also achieve same thing using double pointers.
3 2 1
- Passing Reference to a Pointer in C++
- When do we pass arguments by reference or pointer?
- Passing by pointer Vs Passing by Reference in C++
- Double Pointer (Pointer to Pointer) in C
- Applications of Pointers in C/C++
- MakeFile in C++ and its applications
- stringstream in C++ and its applications
- strchr() function in C++ and its applications
- C++ string class and its applications
- C++ String Class and its Applications | Set 2
- INT_MAX and INT_MIN in C/C++ and Applications
- Can C++ reference member be declared without being initialized with declaration?
- 'this' pointer in C++
- Opaque Pointer
- Pointer vs Array in C
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.