Ciao ragazzi mi chiedo una cosa:

questo codice stampa sul file la prima volta, poi cancella tutti i dati e stampa nuovamente.
Vorrei evitare tale fenomeno.

codice:
ofstream myfile ("C:\\Users\\Niko\\Desktop\\Focco.for");
  if (myfile.is_open())
  {
    myfile << RGBstring;
    //MessageBox(NULL,"The writing on the .for file has tried","Information",0);
    myfile.close();
  }else MessageBox(NULL,"The writing on the .for file has failed","Warning",0);
RGBstring="";
//Seconda stampa
ofstream myfile ("C:\\Users\\Niko\\Desktop\\Focco.for");
  if (myfile.is_open())
  {
    myfile << RGBstring;
    //MessageBox(NULL,"The writing on the .for file has tried","Information",0);
    myfile.close();
  }else MessageBox(NULL,"The writing on the .for file has failed","Warning",0);
RGBstring="";