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 do you mean by a template?
Can you Mention some Application of C/C++?
What is called array?
What do you mean by volatile and mutable keywords used in c++?
What do you understand by zombie objects in c++?
What is singleton class in c++?
Can a program run without main in c++?
What are register variables?
How can we read/write Structures from/to data files?
What is a flag in c++?
How long does it take to get good at leetcode?
what are the decision making statements in C++? Explain if statement with an example?
Explain what are mutator methods in c++?
Can I learn c++ without learning c?
What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?