+ 4
what is pointer in c programming?
10 Réponses
+ 8
Pointer is a variable that hold address of memmory location of an another value .
+ 6
Pointers scare a lot of beginneing C programmers, and even experienced programmers of other languages. but the the reason is just misunderstanding it. Why a pointer is called pointer? it points at something, a location in memory so the pointer is a variable that stores the address of another variable and not the value.
+ 5
just like everyone have said, let me just add this little human made explanation which might be a little incorrect, pointer is like knowing the address to your friends home, you don't need to wait at the junction to get to your friend, you will just go over and knock on his door, and while you know the address you know your friend's family and can play with em, but if you have been waiting at the junction without knowing the address you won't enjoy that privilege, I hope this is cool
+ 3
your point is cool Kay/Nemo, i understand what you mean now
+ 2
To understand pointer in simple language: then pointers are also like variables but they store the address of another variable. They does not store any value, they just store address.
Now, pointer stores address of that variable which it is pointing to.
Consider # as a pointer $ as a variable so,
#->$
This shows that # stores address of $.
Pointers can be of any type like float, double, etc.
+ 2
Pointers are just integers. That's it. There's literally nothing else to them. The compiler allows you to associate a type to them so it can verify your code is correct, but this isn't enforced at the assembly level. That's why they're both powerful and dangerous, like a chainsaw! VROOM!
+ 2
Kay/Nemo are you sure about that???
+ 1
I love how I got downvoted for sharing technical info. You guys go out and learn x86 assembly and come try again, eh?
0
About them being just ints in the assembly or them being like chainsaws?