DEV Community

Discussion on: Why use pointers at all.

Collapse
 
sgkul2000 profile image
Shreesh Kulkarni

There are multiple reasons for using a pointer. I will give you some :

  • preventing making copies of data. using a pointer to alter data alters the original data instead of creating new copies fo the data.
  • Using complex structures of data. Using pointers can facilitate the use of complex data structures like stacks, queues, and linked lists.
  • Pointers can be used to pass arrays and strings to functions these are a few advantages that practically make sense and I have used pointers for the above reasons itself. if you need more information or you wanna discuss then feel free to do so.