Oops concept operator overloading

what’s the benefit of making member function and variables as const?

Hi Archit,
Benefit of making member variables constant is assume there a variable exit which value must remain constant throughout the program then you can use constant keyword. Also if you want some member function which do not modify object value no to call other non constant member functions then you can define the function as constant function.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.