const member functions

Discussion in 'C++' started by Denver Dash, Dec 1, 2003.

  1. Denver Dash

    Denver Dash Guest

    I've been having trouble with my news reader. Sorry if I posted this message
    multiple times...

    Hi. I heard once that there is a way to allow a const member function to
    alter the value of a member if the member is declared in some way. Can
    someone tell me how to do that, or is this impossible?

    For example:

    class foo
    {
    specialdeclaration int index;
    void bar() const
    {
    index = 0; \\ ok because index has been declared in a special way.
    }
    };

    thanks,
    denver.
    Denver Dash, Dec 1, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cheeser
    Replies:
    17
    Views:
    723
    cpp_weenie
    Oct 18, 2003
  2. puzzlecracker
    Replies:
    2
    Views:
    403
    Siemel Naran
    Feb 7, 2005
  3. Javier
    Replies:
    2
    Views:
    559
    James Kanze
    Sep 4, 2007
  4. fungus
    Replies:
    13
    Views:
    886
    fungus
    Oct 31, 2008
  5. Hicham Mouline
    Replies:
    0
    Views:
    432
    Hicham Mouline
    Apr 23, 2009
Loading...

Share This Page