+ 2

Practical Example of Pointers in C++?

I have a rough time trying to understand a concept if I don't know why I would use it for. So about pointers, there are many blogs, videos and posts explaining what they are and what are their advantages, and all this I understood. However, I still could find a clear use case for it. Can someone please give me an example of where pointers would be useful, preferably more complex than just the basics, so I can have an idea? Why would I mess with memory addresses, references and stuff, if I could simply work with basic variables? Disconsidering the advantages such as processing time, better memory management, etc. Perhaps I'm searching for a real case. For those who already pass through a situation at work where they thought "Here I HAVE to use pointers, there's no other way", how was it? How did you do it? It would help me a lot to get to know real use cases! Thanks in advance!

15th Sep 2021, 10:09 AM
Rafver
Rafver - avatar
2 Antworten