The main reasons to use pointers are: To assign a variable from another function To modify a variable from a member function To manage copy on function call
The main reasons to use pointers are:
Strongly disagree. Those are all things pointers can be used for, but they’re all relatively incidental. The overwhelmingly most important reason for the existence of pointers: data structures.
Thanks for catching this.
I’ll add a section on data structures :)
Actually it is not specific to pointer, any reference mechanism should be able to do the same, for example python objects ar list.
Strongly disagree. Those are all things pointers can be used for, but they’re all relatively incidental. The overwhelmingly most important reason for the existence of pointers: data structures.
Thanks for catching this.
I’ll add a section on data structures :)
Actually it is not specific to pointer, any reference mechanism should be able to do the same, for example python objects ar list.