Why is it an error to add a const modifier, as shown to the declaration for the member function input given here?

```
class BankAccount
{
public:
void input( ) const;
// other members
};
```
What will be an ideal response?

If an input routine actually contains code to do input, the function will not compile.
Explanation:
The purpose of and input function is to change the state of the calling object. The
purpose of the const modifier placed as shown is to prevent compiling of code that
changes the state of the calling object.

Computer Science & Information Technology

You might also like to view...

The File Explorer address bar contains ________ and ________ buttons

A) Maximize, Minimize B) Up, Down C) Left, Right D) Back, Forward

Computer Science & Information Technology

If the underlying data for a PivotTable changes, you must ________ the PivotTable to show the changes

Fill in the blank(s) with correct word

Computer Science & Information Technology