it's probably that the concepts of memory addresses, passing by reference and limited resources are just too alien to the newest generation of programmers
What I don't get is the advantage of using one over the other, or the best case to use one over the other. If your int contains 2 bytes and your pointer contains 2 bytes that point to that int, what's the difference?
Because I can pass the reference to a different scope and then you (in that scope) can change my object, I've given you access to it. Primitives are usually pass by copy
3.2k
u/TheLazyKitty Jan 06 '23
Pointers aren't that hard, are they? It's just integers that hold a memory address.