Capgemini interview question

File handling in c++