Both ios::ate and ios::app place the file pointer at the end of the file when it is opened. The difference between the two is that ios::app lets you add data to the end of the file only, while the ios::ate mode when opened with ofstream allows you to write data anywhere in the file, even over old data.