answersLogoWhite

0


Best Answer

Immutable values are easier to understand, track, and

reason about, so prefer constants over variables wherever it is

sensible and make const your default choice when you define a value:

It's safe, it's checked at compile time, and it's integrated with C++'s

type system."

The same applies to const member functions, which essentially just make

the "this" pointer const.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write any two advantages of declaring a member function as const?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What r the Demerits of function in C?

Write a merits and demerits of using function in program


How do you find and write the domain of a function?

how don you find write the domain of a function


What is advantages and disadvantagesof progressing civilisation?

One of the advantages is being able to write.


How to write a Letter declaring bankruptcy?

In the US, a bankruptcy is petitioned and decided in a Federal Court. It is not done with a letter.


How do you write the inverse function of -4?

Well, it would be hard to write an inverse function of -4, since -4 is not a function in the first place.


What are the advantages for predictive text?

advantages of predictictive text is it helps tou to write the text more quicker and it give you the write spelling of the text.


What is CPU and write the function of its two main componentsie alu and cu?

write the function of cpu


Write a C plus plus function that print a triangle of stars?

Write a function that print a triangle of stars.


What is the function of a pencil?

the function of a pencil is to write with out getting your hands dirty and to be able to write on paper instead of stone.


What do you know about structure programming language?

first write main function and what are the use classes which type you want then give the data members to the member functions finally you will terminate the program


What are the advantages and disadvantages of plate girder bridge?

write it properly here


How do you write the rule for a sequence?

You can write it as Un or f(n) equal to some function of n, where the function can be anything at all.