Results 1 to 7 of 7

Thread: pointer and iterator

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: pointer and iterator

    Quote Originally Posted by wysota View Post
    If "x" is an iterator then "*x" returns a reference on the object pointed by the iterator and "x->" is a shortcut for "(*x).". This all has nothing to do with pointers. "*" is the dereference operator.
    I was going to say that it has nothing to do with iterators, but only with pointers because dereferencing is strictly related to pointers.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: pointer and iterator

    I'd say you could dereference anything that is a reference to something else. By dereferencing a street address, you get the house object "pointed to" by the address Iterator is such an address (but not a pointer in strict sense).

Similar Threads

  1. QLinkedList iterator
    By ^NyAw^ in forum Qt Programming
    Replies: 8
    Last Post: 18th October 2007, 16:15
  2. vector iterator as pointer problem
    By Teerayoot in forum General Programming
    Replies: 3
    Last Post: 6th May 2007, 20:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.