How const functions will be treated by compiler?

Answers were Sorted based on User's Feedback



How const functions will be treated by compiler?..

Answer / 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

How const functions will be treated by compiler?..

Answer / window

Question is "How const functions will be treated by
compiler?" you guys answered the question "What do you now
about const functions?"

Please do not write what you know. Because of answers like
this, questions in websites are becoming obsolete.

Is This Answer Correct ?    1 Yes 0 No

How const functions will be treated by compiler?..

Answer / anil

it not allow to change value of the const variable.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C++ General Interview Questions

Write a corrected statement in c++ so that the statement will work properly. if (x = y) x = 2*z;

2 Answers  


How many namespaces are there in c++?

0 Answers  


When does a name clash occur in c++?

0 Answers  


What is protected inheritance?

0 Answers  


What is namespace & why it is used in c++?

0 Answers  






Find the second maximum in an array?

12 Answers   HCL,


What is stack unwinding?

0 Answers  


What is #include iostream?

0 Answers  


Which of the Standard C++ casts can be used to perform a ?safe? downcast: a) reinterpret_cast b) dynamic_cast c) static_cast d) const_cast

2 Answers   Quark,


How can I disable the "echo" feature?

0 Answers  


Explain what data encapsulation is in c++?

0 Answers  


What is the full form of c++?

0 Answers  


Categories