So I do competitive programming and I often need to use files, so I usually do it like this:
ifstream fin ("fileName.in"); ofstream fout ("file