I just started studying C++, and I met this new guy: ->. I was wondering if it means something different than (.) or not, and if it does, what it is.
Can you answer that? I looked for it a bit, but I didn´t find anything to answer my question.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you start with a pointer to an object, use
->. If you start with a reference or direct value of class type, use.. If you use the wrong one, the compiler should give a pretty clear error message.a->bis defined to be synonymous with(*a).b.Except in the case of operator overloading, in which case
->and*must be overloaded separately, and.cannot be overloaded.