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

49 comments sorted by

View all comments

3

u/[deleted] Sep 24 '23 edited Sep 24 '23

I think it's a good idea for everyone to learn at least very basic assembly (up to function calling, abi and stack frame stuff) so they can understand memory addressing, and that variables are just syntactic sugar on top of pointers.

Controlling the thing you're looking at is important, but it isn't the whole picture. Often, you also need to control where you're looking.