#include using namespace std ; #include using namespace std; class student { private: int id ; public: // constructor student(int idP) : id(idP) {} // A const function. Cannot change the data // members of the class. //changes roll with the help of const_cast void function1() const { ( const_cast (this) )->id = 5; } int getId() { return id; } }; int main(void) { student s1(3); cout << "Old id number: " << s1.getId() << endl; s1.function1(); cout << "New id number: " << s1.getId() << endl; return 0; }