Ask 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,!, 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. 12 July, 23:40
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers