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 are the syntactic rules to be avoid ambiguity in multiple inheritance?
What do you mean by early binding?
What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.
What is the use of c++ programming language in real life?
Why can’t you call invariants() as the first line of your constructor?
What are the implicit member functions of class?
Which programming language is best?
Why was c++ made?
What is microsoft c++ redistributable 2013?
Write a program to concatenate two strings.
Is c++ a difficult language?
Is it possible to write a c++ template to check for a function's existence?
What is the syntax for a for loop?
What is the use of class in c++?
Which software is best for programming?