nicktherod
Programmer
I want to write a struct to a txt file. Using CFile i can create the file ready for writing, however when i use write i get an error C2059: syntax error : ','. I am sure it is something obvious, but i'll be buggered if i can see it.
My code is as follows:
struct db
{
int Status;
};
db Temp; //Initialise the struct
//I add values to the struct
try
{
CFile file( pfilepath, CFile::modeCreate|CFile::modeWrite );
file.Write(Temp* , sizeof(struct db));
}
catch(CFileException* pFE)
{
pFE->ReportError();
}
My code is as follows:
struct db
{
int Status;
};
db Temp; //Initialise the struct
//I add values to the struct
try
{
CFile file( pfilepath, CFile::modeCreate|CFile::modeWrite );
file.Write(Temp* , sizeof(struct db));
}
catch(CFileException* pFE)
{
pFE->ReportError();
}