|| is used for logic operations normally used in if statement but what is | is it same as | if we write if (3||4) and than if (3|4) are both statements same another code is that i find confusing is :
I know that you often connect flags like ios::app or WS_OVERLAPPEDWINDOW wiv | and not wiv ||. But i think it makes no difference. Once i used || instead of | and it worked too.
But i dont know if you can do
This statement: file.open(“GROUP.DAT”, ios::app | ios::out | ios::in | ios::binary );
is using the bitwise or operator to combine a number of flags. Think of each value such as ios::out or ios::app as being a binary number with a single bit set, perhaps something like this: 00010000 or 00000010 (I don't know the actual values).