![]() |
What are the uses of pointers? |
[Edit] |
Answer
The main advantages of using pointers are
1.) Function cannot return more than one value. But when the same function can modify many pointer variables and function as if it is returning more than one variable.
2.) In the case of arrays, we can decide the size of the array at runtime by allocating the necessary space.
C has a minimum number of fundamental data types - a single character, a single integer or float, and a few derived data types such as a structure, an enumerated list, and an array. If you want to do much more than that, you make use of pointers.
Pointers allow you to dynamically request memory to store off information for use later. They allow you to create linked lists and other algorithmically oriented data structures.
First answer by ID3507516259. Last edit by Devshri. Contributor trust: 4 [recommend contributor]. Question popularity: 19 [recommend question]




