Let us work through a complete example with the following date class as the user-defined type:
class date { public: date(int d, int m, int y); date(const tm& t); date(); // more constructors and useful member functions private: std::tm tm_date; };
This class has private data members of type std::tm, which is the time structure defined in header file <ctime>.