• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

Constant objects

Hi friends,
          Why is it not possible to invoke a nonconstant member function using a constant object?.Thanks a lot.
0
tmmet
Asked:
tmmet
1 Solution
 
Booth882Commented:
because that is the whole idea behind constant objects, that you cant change anything in it.  functions that are not declared const are able to change the data in an object and therefore would defeat the whole purpose of declaring it const in the first place, so const objects are not allowed to call them.  it is one more instance of rigid c++ object oriented programming
0
 
nietodCommented:
tmmet, these are beginning to sound a lot like homework questions.  We can ASSIST you on your homweork to some degree, but we cannot do it for you.   That is unethical and is cause for removal from EE (for both you and us).
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now