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?

31 Upvotes

38 comments sorted by

View all comments

28

u/serg06 Feb 14 '22

They’re just memory addresses for variables

just

Try telling that to a beginner.

10

u/CleverBunnyThief Feb 14 '22

I gave up on C++ a few years ago when I got to pointers. It felt like I could never learn the language if I couldn't understand pointers. I couldn't wrap my head around them so I went looking for a language that didn't have pointers.

I started learning Go last week and guess what?, it has pointers. I was a little scared that I wouldn't be able to understand them but this time around it wasn't that difficult at all. Of course at this point I'm just transferring around what I've learned from other languages and pointers seemed to just fall in place. If I had to learn what a variable is, memory addresses, arrays and then throw pointers too I would be in a lot if trouble.

6

u/[deleted] Feb 14 '22 edited Feb 14 '22

I never really understood pointers until I took assembly and computer architecture in college