Hi,
I am newbie in VC++ and come across something that I dont quite understand but it should be pretty simple.
During function prototyping what difference does the keyword const make
for example
DWORD GetPlatformID() const;
versus
DWORD GetPlatformID();
Thanks a bunch

Newbie question about const
David Vertex Harris
Thanks. This is a good one.
For reference of others, more information can be obtained here
http://msdn2.microsoft.com/en-us/library/4h2h0ktk(VS.80,d=ide).aspx
eebrown
What exactly do you mean when you say
"won't change an instance of the class"
Is there a function that could change instance of the class If so, how could it be done
nathan.wells
Krishnareddym
See http://msdn.microsoft.com/library/default.asp url=/library/en-us/vccelng/htm/tions_25.asp
Brian Teutsch
mattpdk
class demo {
public:
void method1() const;
void method2();
};
void testconst(const demo& obj) {
obj.method1();
obj.method2(); // Error C2662
}
Fran M.
I get it now.
Chandrashekhar K
Thanks. This is a good one.