1. Note that a friend function is different from a member function of a class. In a friend function, you cannot directly access a member of the class. Void the show () {cout < < m_name < < “age” < < m_age < < “, the result is “< < m_score < < endl; }
When a member function is called, it implicitly adds the this pointer to the object on which it was called, thereby using the members of that object; Show () is a non-member function, and without the this pointer, the compiler does not know which object member to use. To make this clear, you must pass the object as an argument (either directly, or by passing an object pointer or reference) and specify the object when accessing the member.
2. Objects of a class cannot be created directly after it is declared in advance, because the compiler cannot determine how much space to allocate. Objects of a class can only be created after it is formally declared (after data members are determined). But you can define a pointer variable or a reference variable for that class,