Having an issue with ios::app. I'm using the Xcode application on my Mac to compile it. Here's the code:

Code:
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
char buffer[250];
fstream myfile;
myfile.open("testtext", ios::out | ios::trunc);
	if(myfile.is_open())
	{
	myfile << "This is output \n";
	myfile.close();
	}
myfile.open("testtext", ios::in);
myfile.getline(buffer, 100);
cout << "The file contains    " << buffer << endl;
myfile.close();
myfile.open("testtext", ios::app);
myfile << "Hey this is YET another line of output \n";
myfile.close();
myfile.open("testtext", ios::in);
myfile.getline(buffer, 100);
cout << "The file contains    " << buffer << endl;
myfile.close();

return 0;
}
When the compiled program runs:

The file contains This is output
The file contains


It leaves a blank after the second output. Why? I'm a beginner at learning C++ but I'm pretty sure that the second output should display both things written to the file right? Because "app" was supposed to "append" the line to the file therefore making two lines? So, yeah, I'm confused. Really would like some help on this please.