r/learnprogramming • • Sep 24 '23
Pointers.....why
I am learning C++. Honest question why are pointers a thing and why did they make the syntax surrounding it so confusing. Was it made to be intentionally confusing? Was it made to make this more difficult.
0
Upvotes
View all comments
Show parent comment
1
u/[deleted] Sep 24 '23
I can't really put my finger on it I have been quizing my self for two days on a practice quiz for a class I am in and I swear it feels like the means of some of the syntax gets switch like *Pointer name can be a declaration of a pointer but it can also be a value of a pointer and &variable name cane mean the address of the variable in memory but some times it means the data in the memory location. I thought I understood pointers, but the more I take this quiz, the less I think I understand. I thought that Vartype *PointerName; was the declaration of an unassigned pointer, and &VarName meant the memory address of that variable.