ben3019201
ben3019201

Reputation: 391

Terminology C++ - Members

If someone says "members in the class" are they talking about the data members, or the member functions? I'm a little confused on which one they are talking about.

Upvotes: 3

Views: 237

Answers (1)

Sarfaraz Nawaz
Sarfaraz Nawaz

Reputation: 361612

By "members of a class" could mean all these:

  • data members
  • member functions
  • nested types

So if you have this class:

class A
{
    typedef std::string value_type;  //nested type
    value_type  v;                   //data member
    int         w;                   //data member
    void f();                        //member function
    struct B {};                     //nested type
};

then value_type, v, w,f and B are members of the class A.

Upvotes: 7

Related Questions