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.

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 c++ code that will calculate the roots of a quadratic equation a2+ bx+c=0 Hint: d = sqrt (b2-4ac), and the roots are: x1 = (€“b + d)/2a and x2 = (€“b €“ d)/2a (use sqrt function from cmath.h )?

0 Answers   Maxobiz,

Explain about profiling?

1 Answers  

how can u create a doubly linked list with out using pointers?

2 Answers  

Consider the following code fragment: int main(void) { int m = 4; mystery ( m ); mystery ( m ); printf("%d", m); return 0; } What is the output on the monitor if mystery is defined as follows ? void mystery (int m) { m = m+3; }

2 Answers   Wipro, CDAC,

what are difference between c and c++?

9 Answers   Accenture,

write a C++ programming :if the no is between 32 to 50 it will be odd.

3 Answers   NIIT,

What is the Difference between "printf" and "sprintf"?

7 Answers   TCS, iSoft, PentaWare,

What are advantages and disadvantages of Design patterns?

6 Answers   IBM, Vodafone,

What are the different operators in C++?

3 Answers   HP,

How to construct muliton object

2 Answers   TCS, Symphony,

What are different types of polymorphism supported by C++

2 Answers   GameLoft, CA,

What will happen if when say delete this ?

7 Answers