Post #3224318
2026-06-09 13:06 UTC
A pointer to the list would allow you to modify whatever’s at that pointer’s address though. If you want to look at the list and not edit it you pass by const reference 99% of the time, and if your language doesn’t have that I don’t like it.
Replies (1)
-
@captcha_incorrect@lemmy.world 2026-06-09 14:12
I still don’t get the point of pointers. I want my language to pass by reference. I give a variable to a function and the variable in the function scope should be a reference to the same place in memory as the original variable. How can pointers help me here? What value does it provide? Genuine question.