> Suppose there is a function f() which returns an integer and does not change > any value of the class it belongs to, should I declare it as: > > const int f(); > > or > > int f() const; This one. > What is the difference? Thank you. The first one returns a 'const int.' The second one is an immutable function. - : send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html