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 is polymorphism?

14 Answers   Accenture,


How to construct muliton object

2 Answers   Symphony, TCS,


How is c++ different from java?

0 Answers  


why v use c++ even we have microprocessor

2 Answers   CybAge,


Explain the difference between struct and class in terms of access modifier.

0 Answers  


Are iterators pointers?

0 Answers  


Is java a c++?

0 Answers  


What is functions syntax in c++?

0 Answers  


What's the most powerful programming language?

0 Answers  


Enter n no. of element and delete value from desire position

1 Answers  


What are pointers used for c++?

0 Answers  


Explain what are accessor methods?

0 Answers  


Categories