Results 1 to 4 of 4

Thread: pointers

  1. #1

    pointers

    hello guys,
    I want to know the difference between pointer and reference. Are these similar or not. Please explain me.
    thanks.

    PUNJABIAN263

    ***GREAT PEOPLE HAVE GREAT PUPIL***

  2. #2
    Senior Member
    Join Date
    Jul 2002
    Posts
    315
    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.

    Guidance...
    - The mind is too beautiful to waste...
    Cutty


  3. #3
    Senior Member
    Join Date
    May 2002
    Posts
    344
    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

  4. #4
    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.


    http://www.codeproject.com/cpp/pointers.asp
    I Speak in frequencies even dogs have trouble hearing


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •