|
-
March 31st, 2011, 12:35 AM
#1
[RESOLVED] FStream Problem
Hi
I cannot write to file ! No errors but nothing happens ...
This is my code :
void SaveColors()
{ try
{
fstream OutFile;
OutFile.open("c:\Colors.txt",ios: ut);
OutFile << TargetCount << endl << endl;
//Write SceneTargets to output file
for (int i=0 ; i<TargetCount ; i++)
{
OutFile << SceneTargets[i].title << endl;
OutFile << SceneTargets[i].NumberOfColors << endl ;
for(int j=0 ; j<SceneTargets[i].NumberOfColors ; j++)
{
OutFile << SceneTargets[i].Colors[j].h << " " ;
OutFile << SceneTargets[i].Colors[j].s << " " ;
OutFile << SceneTargets[i].Colors[j].v << " " ;
}
OutFile << endl ;
}
//Write changes to disk
OutFile.close();
}
catch (char* str)
{
cout << "Error : Cannot write to file" << endl ;
}
}
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|