Can someone explain what it is when a pointer is used as the name of the class when adding a method to the class? Something like this:
cMessage *Tic9::generateNewMessage()
Can’t find a way to search for that on google and my C++ knowledge is lacking.
It isn’t used as the name of the class, it’s part of the return type, pure and simple.
That declares a member (of
Tic9) function namedgenerateNewMessagewhich takes no parameters and returns acMessage*(a pointer). Since it can’t be the in-class declaration (which wouldn’t be qualified by the class name), presumably it’s part of an out-of-class definition of the function (a definition is a declaration).Or, if a declaration isn’t legal in the current context, it’s an expression multiplying
cMessageby the result of calling a static member (ofTic9) function namedgenerateNewMessage.