0
What's the main use of pointers in c++ and when they are pretty useful ?
3 odpowiedzi
+ 1
Often you just need to use "normal" variables, but sometimes it's more efficient to handle data via pointers. They allow you to manage the your allocated memory and let you change the value of a variable indirectly, which are both features that are often really useful. Just try coding a bit with pointers and you will better understand the advantages
0
what about the dynamic memory ? the use of new int...
0
They are mainly used if you allocate something on the heap, like a class or an array, you don’t really need them that often if you are just working on the stack