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
Explain the static storage classes in c++.
What is iterator c++?
Can I uninstall microsoft c++ redistributable?
What is the difference between while and do while loop?
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
Describe the advantage of an external iterator.
What is null pointer and void pointer?
What is the rule of three?
What are the various situations where a copy constructor is invoked?
explain the reference variable in c++?
What are exceptions c++?
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
What do you mean by translation unit?
What is the role of C++ shorthand's?
Explain class invariant.