The class concept

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
$ \tilde{\;}$ TimeStamp(); // destructor
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
};



Leo Liberti 2008-01-12