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


Please Help Members By Posting Answers For Below Questions

Which one is a preferred language C or C++? Why?

814


Write about a nested class and mention its use?

809


What is the first name of c++?

749


what Is DCS ? what i will get benefit when i did?

2022


Explain how an exception handler is defined and invoked in a Program.

818






What are the benefits of pointers?

750


What does return 0 do in c++?

793


Is c++ a pure oop language?

801


We use library functions in the program, in what form they are provided to the program?

819


What do you mean by inheritance in c++?

802


What is binary search in c++?

770


How much do coding jobs pay?

744


When is the destructor called?

764


int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}

1014


What type of question are asked in GE code writing test based on c++ data structures and pointers?

3692