How const functions will be treated by compiler?
Answer Posted / 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 |
Post New Answer View All Answers
What is pointer in c++ with example?
What is c++ redistributable?
What does the nocreate and noreplace flag ensure when they are used for opening a file?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
How do you clear a buffer in c++?
Explain how functions are classified in C++ ?
What is the difference between prefix and postfix versions of operator++()?
What is the disadvantage of using a macro?
What is array in c++ example?
How many keywords are used in c++?
Define basic type of variable used for a different condition in C++?
What is the purpose of the "delete" operator?
Comment on local and global scope of a variable.
What do you mean by inheritance in c++?
Comment on assignment operator in c++.