What is the meaning of const in declarations like these? The const confuses me.
const
class foobar { public: operator int () const
when you use const in the method signature (like your said: const char* foo() const;) you are telling the compiler that memory pointed to by this can't be changed by this method (which is foo here).
const char* foo() const;
this
foo