Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) data member

 

A data member, or member variable, is a variable internal to a class.

 

The class shown below has a single data member called 'm_x', which is of type int:

 

struct MyClass
{
  int m_x;
};

 

Use a consistent method (such as a d_ prefix) to highlight class data members [1].

 

 

 

 

 

References

 

  1. John Lakos. Large-Scale C++ Software Design. 1996. ISBN: 0-201-63362-0. Chapter 2.7: 'Use a consistent method (such as a d_ prefix) to highlight class data members'

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict