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

How to detect memory leaks in c++

1 Answers   Mphasis,

How many types of casting are there in C++? When is a dynamic cast,static_cast,reinterpret cast used?

2 Answers   CTS,

Adobe Interview & Adobe Placement Paper

1 Answers   Adobe,

Copy Linked List using recursive function?

2 Answers   Persistent,

class professor {}; class teacher : public virtual professor {}; class researcher : public virtual professor {}; class myprofessor : public teacher, public researcher {}; Referring to the sample code above, if an object of class "myprofessor" were created, how many instances of professor will it contain? a) 0 b) 1 c) 2 d) 3 e) 4

4 Answers   Quark,

Difference between Operator overloading and Functional overloading?

10 Answers   HP,

Can you explain the term "resource acquisition is initialization?"

1 Answers  

What is scope of a variable? (LOLZ)

2 Answers   TCS, CA,

What is size of a object of following class? class Foo { public: void foo(){} }

2 Answers   CA,

write a program to add two numbers without using an arithmetic operator.

1 Answers   NIIT,

write program for palindrome

81 Answers   Syntel, Aricent, Amazon, HCL, Temenos, GE, CSC, Wipro, Infosys,

When to use Multiple Inheritance?

6 Answers