How const functions will be treated by compiler?
Answer Posted / achal ubbott
A member function can be const qualified. e.g.
class SAAMPLE
{
int m1;
void f() const;
}
Now function f will not be able to modify the value of data
members. If so done the compiler would report an error.
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Why is polymorphism useful?
How do you print a string on the printer?
What is polymorphism and its type in c++?
What is data types c++?
What is the object serialization?
How to declare an array of pointers to integer?
Why do we use classes in programming?
What is late binding c++?
What is class in c++ with example?
Should I learn c or c++ first?
What is c++ & why it is used?
What kind of jobs can I get with c++?
Why do we use the using declaration?
What is decltype c++?
Can we define a constructor as virtual in c++?