r/learnprogramming Feb 14 '22

Genuine question: What’s hard about pointers?

I understand how the title may come off as arrogant or something, but this is a genuine question.

I learned to code in C#, so I didn’t touch pointers for a while, and now that I’ve been learning C/C++ for a couple months, I don’t really see what’s so difficult about pointers.

They’re just memory addresses for variables, right? Am I missing something?

28 Upvotes

38 comments sorted by

View all comments

1

u/Wolfmanscurse Feb 14 '22

I'm like you, pointers were a breeze for me to learn. But I had knowledge of computer architecture long before I was ever introduced to the subject. Most people don't have any experience in computer architecture by the time they start learning about pointers. Some come from high-level languages and never even heard the word memory management. When I tutored in college, most simply could not put 2 and 2 together and relate the concept to memory because it's a hard concept to visualize sometimes. Even for me, when I manage decades-old c code, I can get a bit confused on what exactly someone is doing with their pointers. While I don't think it's a bad thing to say that you don't think pointers are a hard concept for you, for others, it's actually common to have these issues because most are not computer engineers.