Elementary question on const
From: Last Timer (dakshing64_at_yahoo.com)
Date: 01/30/05
- Next message: Old Wolf: "Re: Why is my const pointer not behaving?"
- Previous message: Mike Wahler: "Re: VC++ project crashes in Windows 9x"
- Next in thread: Mike Wahler: "Re: Elementary question on const"
- Reply: Mike Wahler: "Re: Elementary question on const"
- Reply: David Harmon: "Re: Elementary question on const"
- Reply: Thomas Matthews: "Re: Elementary question on const"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Jan 2005 11:31:14 -0800
I encountered the following code in Bruce Eckel's online book. Can you
please clarify what "const char* const data;" means? Thanks
//: C01:MyError.cpp {RunByHand}
class MyError {
const char* const data;
public:
MyError(const char* const msg = 0) : data(msg) {}
};
void f() {
// Here we "throw" an exception object:
throw MyError("something bad happened");
}
int main() {
// As you'll see shortly, we'll want a "try block" here:
f();
} ///:~
- Next message: Old Wolf: "Re: Why is my const pointer not behaving?"
- Previous message: Mike Wahler: "Re: VC++ project crashes in Windows 9x"
- Next in thread: Mike Wahler: "Re: Elementary question on const"
- Reply: Mike Wahler: "Re: Elementary question on const"
- Reply: David Harmon: "Re: Elementary question on const"
- Reply: Thomas Matthews: "Re: Elementary question on const"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]