Answer Posted / som shekhar
If the function is declared constant then you are not
intended to change the member variables of the class and if
you did the compiler throws an error.
In this case you can change the variable inside the const
function if the variable is declared as VOLATILE.
Similarly if you declare a variable as const then you cannot
change the value of the variable through its life time.
Now if you declared the constructor then you cannot
initialize the object.
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is c++ redistributable?
Briefly describe a B+ tree. What is bulk loading in it?
What is the difference between a definition and a declaration?
What is late binding c++?
What is runtime errors c++?
What is the difference between global int and static int declaration?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
What is c++ vb?
How do you sort a sort function in c++ to sort in descending order?
What is a static element?
What are the basics of local (auto) objects?
What is main function in c++ with example?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
Comment on c++ standard exceptions?
Define the operators that can be used with a pointer.