Tuesday, September 29, 2009

The story const member functions

C++ is strange in its own ways. This one beats the rest....

C++ allows a class to have const functions

the declaration would typically look like this

::() const

this function cannot modify the data members of the object of the class

But here is a workaround, call the data members "mutable" and get a back door entry to modifying the elements of the object

C++ programming gets as interesting as it can....