Assume the existence of a File class with boolean data member, isValid, indicating the file is ready for I/O. Write a unary operator, !, that accepts a constant File reference, and returns true if the file is not ready for I/O and false otherwise.

Respuesta :

Answer:

The description for the given question is described in the explanation section below.

Explanation:

In reality, the "!" operator remains overloaded throughout the library of IO-stream, which effectively comes back the contrary feature of good.

It's how that they would load the "!" operator to construct a unary member overloading feature.

Example:

class abc

{

public :

bool isValid ( )    // return true

bool operator ! ( )    // return isValid( )

};

Optionally, to overwhelm the unary, you may build a global feature "!" user.

ACCESS MORE