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 difference between malloc()/free() and new/delete?
What is #include iostream h in c++?
Are strings immutable in c++?
Why we use #include conio h in c++?
Can I learn c++ as my first language?
Is swift faster than go?
What is difference between class and structure in c++?
What is the prototype of printf function?
What is operators in c++?
How to tokenize a string in c++?
Which of the following is evaluated first: a) && b) || c) !
Is c++ fully object oriented?
What do you mean by storage classes?
What is name hiding in c++?
Explain the auto storage classes in c++.