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 implicit pointer in c++?
What does the nocreate and noreplace flag ensure when they are used for opening a file?
What is overloading unary operator?
What is difference between c++ and c ++ 14?
Describe the syntax of single inheritance in C++?
What is the difference between ++ count and count ++?
Explain linear search.
What is a pointer with example?
Explain static and dynamic memory allocation with an example each.
Explain function overloading
What are the various oops concepts in c++?
What is the use of main function in c++?
How would you use the functions memcpy(), memset(), memmove()?
what is multi-threading in C++?
Why is c++ difficult?