September 28th, 2003, 08:36 AM
I want to know the difference between pointer and reference. Are these similar or not. Please explain me.
***GREAT PEOPLE HAVE GREAT PUPIL***
September 28th, 2003, 06:30 PM
Pointer and reference are similar in some ways while they are really different. It's really not easy to explain the difference but I will see if I can clarify for you.
Pointers can be used to create link lists, stacks etc but reference can't. You can de-reference a pointer. Well reference is an address whilst a pointer points to an address. So I guess what am trying to say is that a pointer can be treated as a reference but a reference can't be treated like a pointer.
I hope that helps.
- The mind is too beautiful to waste...
September 28th, 2003, 06:51 PM
read this tut if you want to learn how pointers work: http://www.antionline.com/showthread...hreadid=247055
Support your right to arm bears.
^^This was the first video game which i played on an old win3.1 box
September 28th, 2003, 09:19 PM
I guess cutty said it best when you talk about a reference you're talking about an specific space in memory where something is, the adress to it. Whereas a pointer is something that points to somewhere in memory, you usually assign this refrences to pinters. I recommend you reading about pointers for they are a little bit tricky at first but a very useful tool later on when dealing with dynamic memory specially.
I Speak in frequencies even dogs have trouble hearing