Link to home
Start Free TrialLog in
Avatar of eric07
eric07

asked on

Trying to append to a file?

I have the following member function.  
And I cant seem to figure out how to append data to the end of the file.  It overrides everyting.

void CGSPMSDBAccess::saveSQLT( _bstr_t sValue, LPCSTR sTitle )
{
      std::string strValue;

      strValue = (LPCSTR)sValue;

      ofstream handleWriteToFile;

      handleWriteToFile.open( "c:\\temp\\gspmssqloutput.txt", ios::out );

      if( handleWriteToFile )
      {
            handleWriteToFile << sTitle << ":  " << strValue << '\r' << endl;
            handleWriteToFile.close();

      }



}


Any ideas on how to open the file and append to new data to the end of the file?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of BigOne
BigOne

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial