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
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.