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
- Can C++ reference member be declared without being initialized with declaration?
- MakeFile in C++ and its applications
- stringstream in C++ and its applications
- Applications of Pointers in C/C++
- C++ String Class and its Applications | Set 2
- C++ string class and its applications
- strchr() function in C++ and its applications
- INT_MAX and INT_MIN in C/C++ and Applications
- 'this' pointer in C++
- A C/C++ Pointer Puzzle
- NULL pointer 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.