Capgemini Interview Question

File handling in c++