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
Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
How does atoi function work?
What is rvalue?
Why is c++ still used?
When do we use copy constructors?
What is oops in c++?
What is lvalue?
Declare a class vehicle and make it an abstract data type.
What is c++ flowchart?
Which format specifier is used for printing a pointer value?
Write about the members that a derived class can add?
Is the declaration of a class its interface or its implementation?
What are 2 ways of exporting a function from a dll?
Where is atoi defined?
what is data abstraction in C++?