It is a way to let the compiler know that you do not change the object's data. This lets the compiler do fancy optimizations, and lets you use the object in places that it otherwise could not be or wouldn't be allowed to be.
In other words, it is your way of saying "I guarantee I will not change the object's state with this function."
double x, y;
// Getting the angle from the +X axis does not need to
// change the object -- this is a constant function.
double angle() const
return atan2( y, x );
// Setting the angle -- that requires a change
// to the data, so this function is not const.
void angle( double theta )
double s = sin( theta );
double c = cos( theta );
double xx = x*c - y*s;
double yy = x*s + y*c;
x = xx;
y = yy;