Please can someone explain it to me?

why we use const in this case?

1
2
  void function_name()const;
You don't show enough context. Is this a standalone function or a member of a class?
(Assuming it's a member of a class) In this context it means you are not allowed to edit any non-mutable members of this inside the function, it marks it as safe to call on const objects. http://msdn.microsoft.com/en-us/library/6ke686zh.aspx
Last edited on
it's a member of a class
the keyword const makes the a "read only" function.U cant use it to modify data of object but u can use it to read the data of that object.
Topic archived. No new replies allowed.