give 3 applications of pointers in c
Answers
Answered by
2
pointers are generally useful in the context where we need a continuous memory allocation. Using pointers dynamic allocation of memory is achieved
pointers basically hold the address of a variable. they are mainly used as function parameters to pass values of parameters as references rather than values
A few advantages:
- Pointers allow you to implement sharing without copying
- Pointers allow modifications by a function that is not the creator of the memory i.e. function A can allocate the memory and function C can modify it, without using globals, which is a no-no for safe programming.
- Pointers allow us to use dynamic memory allocation.
Hope it's helpful
pointers basically hold the address of a variable. they are mainly used as function parameters to pass values of parameters as references rather than values
A few advantages:
- Pointers allow you to implement sharing without copying
- Pointers allow modifications by a function that is not the creator of the memory i.e. function A can allocate the memory and function C can modify it, without using globals, which is a no-no for safe programming.
- Pointers allow us to use dynamic memory allocation.
Hope it's helpful
Similar questions
Business Studies,
8 months ago
Political Science,
8 months ago
Business Studies,
8 months ago
Math,
1 year ago
Math,
1 year ago
Hindi,
1 year ago
Math,
1 year ago