A class is a user-defined data type. It contains some data fields and the methods (i.e. algorithms) acting on them.
class TimeStamp {
public: // can be accessed from outside TimeStamp(); // constructor ![]() long get(void) const; // some methods void set(long theTimeStamp); void update(void); private: // can only be accessed from inside long timestamp; // a piece of data }; |