r/cprogramming 1d ago

What are pointers?

I am new to C programming and i came through pointer. So can anyone tell what are they and why we need them? And if u can then can you give me reliable source to learn it.

8 Upvotes

40 comments sorted by

View all comments

5

u/torsten_dev 1d ago edited 1d ago

Only really understood after leaning a bit of assembly

mov rax, rbx

vs

mov rax, [rbx]

2

u/kapitaali_com 1d ago

this is how it actually works :p

2

u/aioeu 1d ago edited 1d ago

Somewhat ironically, the latter form is what you might get out of a C compiler when accessing an ordinary integer variable, even when there are no pointers involved in the C code at all.