Ask Question
22 June, 09:29

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.

+5
Answers (1)
  1. 22 June, 12:22
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers