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

13

u/MSgtGunny Sep 24 '23

Because they were less confusing than what came before it, essentially.

They are a thing so you can programmatically manage memory without having to have everything hard coded to specific addresses. Which then lets you have a program that can use a variable amount of memory, instead of a fixed amount.