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

I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.

0 Answers  

#include<iostream.h> void main() { class x { public: int func(int) { cout<<"cool"; return 1; } } }

1 Answers   Infosys,

write a programming using for loop in c++ to generate diamond trangel?

1 Answers   NIIT,

What are the types of STL containers?

4 Answers  

print first nodd numbers in descending order

7 Answers  


6 Answers  

is throwing exception from a constructor not a good practice ?

5 Answers   Ericsson,

What is the difference between a copy constructor and an overloaded assignment operator?

3 Answers   Wipro, Citrix, Microsoft, Belzabar,

wap to accept 10 numbers & display the number of odd and even numbers??

1 Answers  

Write a corrected statement in c++ so that the statement will work properly. x =+ 7;

2 Answers  

What is a "RTTI"?

6 Answers   HCL,

What compiler was used?

6 Answers   Intel,