Thread: Pointer Question

  1. #1

    Question Pointer Question

    This will probably be an easy one for most of you, but for the life of me I can't remember.

    Say we have two pointers (lptr, tptr) and they both point to the same item (lets say the root of a binary tree).

    Now since they are both pointing at the root that means that the addresses of both lptr and tptr and equal (i.e. &lptr == &tptr) right?
    DrakkenKorin

    Get off my Intarweb!!!!

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    65
    No!!!!
    Assume that the root's address is 0x0020ABCD. Then the value of
    lptr and tptr will be 0X0020ABCD. However lptr may for example reside in memory location 0x00ABFFFF whereas tptr may reside in 0x00FFCCCC. The addresses in two pointers may be equal. The addresses of two pointers can not.

  3. #3

    Thumbs up

    Got it,

    In my mind I was thinking addressess but using the dereferencing symbol (*) in my 'mental' logic, so I was thingking yes.

    Thanx!

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    where did you get that name..... are you a valheru?
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  5. #5
    Only in my dreams.

    But Feist had a hand in selecting the moniker
    DrakkenKorin

    Get off my Intarweb!!!!

  6. #6
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    have you read all of the series?

    feist is my favourite author without a doubt!
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  7. #7
    Read'em all. Except for the very last one, the new one. Krondor: Tear of the Gods.

    As far as the new series, Return to Krondor (or whatever it is), I'm not too happy with it. First book was good, story was lost on the second book, and there were even misspellings in it ('put' showing up instead of 'Pug': "...Put said..."). Want the final installment just to read them all.

    From what I've heard, not too many people are too happy with the new series, they think he wrote it to go along with the new game (that comes free with the new book).
    DrakkenKorin

    Get off my Intarweb!!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 04:23 AM
  2. Easy pointer question
    By Edo in forum C++ Programming
    Replies: 3
    Last Post: 01-19-2009, 10:54 AM
  3. char pointer to pointer question
    By Salt Shaker in forum C Programming
    Replies: 3
    Last Post: 01-10-2009, 11:59 AM
  4. Pointer question
    By rakan in forum C++ Programming
    Replies: 2
    Last Post: 11-19-2006, 02:23 AM
  5. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM