C - C++ Files - Append to a binary file

#include <iostream>
#include <fstream>
 
using namespace std;
 
int main()
{
  ofstream outFile("ForgetCodeWrite.out");
 
  if (outFile.fail()) 
  {
    cerr << "Unable to open file for writing." << endl;
    exit(1);
  }
 
  outFile << "ForgetCode!" << endl;
 
  outFile.close();
 
  ofstream appendFile("ForgetCodeWrite.out", ios_base::app);
 
  if (appendFile.fail()) 
  {
    cerr << "Unable to open file for writing." << endl;
    exit(1);
  }
 
  appendFile << "Appending Features!!" << endl;
 
  appendFile.close();
}