Ask Question
18 March, 21:44

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.

+2
Answers (1)
  1. 18 March, 23:17
    0
    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.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assume the existence of a File class with boolean data member, isValid, indicating the file is ready for I/O. Write a unary operator,!, ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers