why use pointers?
Why do we use pointers?
Pointers are used to store and manage the addresses of dynamically allocated blocks of memory. Such blocks are used to store data objects or arrays of objects. Most structured and object-oriented languages provide an area of memory, called the heap or free store, from which objects are dynamically allocated.
Full answer in: en.wikipedia.org
More questions like: Why do we use pointers?
Why should I use a pointer rather than the object itself?
Sometimes you want to pass an object using a pointer (regardless of how it was allocated) because you want the function to which you're passing it to have access that that specific object (not a copy of it). Mar 7, 2014
More questions like: Why should I use a pointer rather than the object itself?
Why would you use a pointer to a pointer?
18 Answers. One reason is you want to change the value of the pointer passed to a function as the function argument, to do this you require pointer to a pointer. In simple words, Use ** when you want to preserve (OR retain change in) the Memory-Allocation or Assignment even outside of a function call.
More questions like: Why would you use a pointer to a pointer?
Why would you use pointers in C++?
Pointers are used for file handling. Pointers are used to allocate memory dynamically. In C++, a pointer declared to a base class could access the object of a derived class. However, a pointer to a derived class cannot access the object of a base class. Jun 3, 2019
Full answer in: www.geeksforgeeks.org
More questions like: Why would you use pointers in C++?