0

Possible Duplicate:
When do I use a dot, arrow, or double colon to refer to members of a class in C++?

Various examples that I see, I've seen them use ::, -> and . . I usually get confused between the last 2. Can someone help me making it clear about the usage of -> and . in VC++ about where can I use it and what is the difference!

Community
  • 1
  • 1
Axe
  • 6,285
  • 3
  • 31
  • 38
  • 1
    The best way to learn C++ is to get [a good introductory C++ book](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). – James McNellis Apr 30 '11 at 04:28
  • 1
    See here: http://stackoverflow.com/questions/4984600/when-do-i-use-a-dot-arrow-or-double-colon-to-refer-to-members-of-a-class-in-c – Pablo Apr 30 '11 at 04:29
  • I'm learning C++ from "Ivor Horton's Visual C++ 2008" book, but I've got the confusion between the symbols "->" and ".", if you could reply to this question with the answer, it would be great. Thanks in advance! :D – Axe Apr 30 '11 at 04:30

1 Answers1

1

-> dereferences the pointer to its left.
. uses the object to its left which is not a pointer.

wallyk
  • 56,922
  • 16
  • 83
  • 148
  • I got the answer "http://stackoverflow.com/questions/4984600/when-do-i-use-a-dot-arrow-or-double-colon-to-refer-to-members-of-a-class-in-c" but anyways thanks for that answer! :D – Axe Apr 30 '11 at 04:33