but w8 cant we write ios::in for ifstream which would imply we are writitng and ios::out for ofstream which would imply we are reading in a sense doesn't that make it simple
but w8 cant we write ios::in for ifstream which would imply we are writitng and ios::out for ofstream which would imply we are reading in a sense doesn't that make it simple
Perhaps you answered your own question. ios::in implies reading, not writing. And similarly ios::out implies writing, not reading.
That's exactly the opposite of what you wrote. Now that's not a big deal, we all make mistakes. But if we get in the habit of restricting access to only that which is needed, then some other errors can be reduced.
This is similar to the principle of specifying const for functions or parameters where the intention is to not modify the value. Again, this can reduce the possibility of accidentally modifying something by mistake.