PDA

View Full Version : Const keywor in c++ 2011



saneha
05-02-2011, 05:30 PM
What is the actual purpose of using const keyword tell me in simple words.

Vuhelper
05-02-2011, 05:32 PM
To define a variable, data member or member function constant, we use the keyword const. constant data member, member function does not change their value.
For example:
const int A=10;
A=20; //Error
Because A is declare as constant, which value can not be changed.