HP3000-L Archives

December 2004, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Keven Miller <[log in to unmask]>
Reply To:
Keven Miller <[log in to unmask]>
Date:
Fri, 17 Dec 2004 14:30:57 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (30 lines)
I figure I'm strong in C, but this C++ sometimes leaves
me baffled.

I'm looking at a class definition with a method
declared twice. With the only difference, the word const.
Can you tell me why or whats going on and why I would do this?


class name:public other {
public:
        virtual bool isOpen() const;
        virtual bool isOpen (void);
protected:
        bool localOpen;
};

bool name::isOpen (void) const {
        return localOpen;
}

bool name::isOpen (void) {
        return localOpen;
}

_______________________________________________
Keven Miller       [log in to unmask]

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2