I got this line into a macro definition of a class
virtual const char *GetEventName() const
{
return #classname;
}
What is happening in this function and its return type?
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
classnameis one of the arguements of the macro,#classnameis a string version of its value. So ifclassnamewereSomeType,#classnamewould be the equivalent of"SomeType"Since it is returning a string (c string) the return type is const char*
For more information look at Stringification