NEED HELP URGENTLY !!!!

Home Forums C Programming NEED HELP URGENTLY !!!!

This topic contains 2 replies, has 2 voices, and was last updated by  Anantha 9 years, 6 months ago.

  • Author
    Posts
  • #2106

    Anantha
    Participant

    hi to whoever reading this. I’m a complete noob to c++ so bare with me if it’s a simple question.
    So, here goes my question:

    What does the question mean by: implementing getter with const method?? Can anyone of you give me an example to this question??

    Thanks

  • #3399

    Humayan
    Member

    Do you mean a constant method of a class implementation? A constant member function of a class is a function that does not alter any class data members , like:
     
     

     check out this link: http://www.uwyn.com/resources/uwyn_cpp_coding_standard/x496.html

  • #3400

    Anantha
    Participant

    Thanks cman! Actually i was kinda confuse on where to put the “const”
    For example:

    what’s the difference between putting the “const” in front and at the back?
     

You must be logged in to reply to this topic.

0 Shares
Share
+1
Tweet
Share
Stumble