I am new to C++ and I am trying to understand some code. What does it mean to have a * in front of the datatype ? and why is the class Name in front of the method name CAStar::LinkChild
void CAStar::LinkChild(_asNode *node, _asNode *temp)
{
}
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.
A * in front of the data type says that the variable is a pointer to the data type, in this case, a pointer to a node. Instead of passing a copy of the entire “node” into the method, a memory address, or pointer, is passed in instead. For details, see Pointers in this C++ Tutorial.
The class name in front of the method name specifies that this is defining a method of the
CAStarclass. For details, see the Tutorial pages for Classes.