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 the difference between a template and a macro?
What is the function of I/O library in C++ ?
What is difference between n and endl in c++?
Write about all the implicit member functions of a class?
What is the difference between global int and static int declaration?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
What are the differences between new and malloc?
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
Is c++ primer good for beginners?
When should overload new operator on a global basis or a class basis?
What is std namespace in c++?
What is the use of pointer in c++ with example?
What is operator overloading in c++ example?
What is general format for a prototype?