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

What methods can be overridden in java?

0 Answers  


Explain the static member function.

0 Answers  


How can you specify a class in C++?

0 Answers  


Why do we use structure in c++?

0 Answers  


What is difference c and c++?

1 Answers  






Is empty stack c++?

0 Answers  


How would you use the functions sin(), pow(), sqrt()?

0 Answers  


What is the best c++ compiler for windows 10?

0 Answers  


Briefly describe a B+ tree. What is bulk loading in it?

0 Answers   Wipro,


What are advantages of C++ when comparing with C?

18 Answers   HP, iGate, TCS,


If dog is a friend of boy, is boy a friend of dog?

0 Answers  


What is format for defining a structure?

0 Answers  


Categories