Whats the difference between
andCode:const void X::y(){ //I think it assure's that even if it returns a pointer or a refrence it cant be changed //such that the pointee or referenced item will be changed //Plese Correct me If I am wrong }
Edit: forgot to add a return Type.Code:void X::y() const{ //Does not alter any data of the class //so can't call any non-const member function too //Plese Correct me If I am wrong }
So now is my Comments Correct ?? I think Wrong..