Binary Search - Opening a file for both reading and writing ============= One of the TAs mentioned that some people are confused about opening a file for reading and writing simultaneously. To open a file for both input and output in C++, you can use the following as "mode": ios::in|ios::out The result is the bitwise-or of the modes indicating input and output. This sets both flags (input and output). Example of usage: fstream iofile; iofile.open("myfile.txt", ios::in|ios::out); Lucia Moura