Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFile::Write - Syntax Error ????

Status
Not open for further replies.

nicktherod

Programmer
Nov 10, 2000
19
0
0
CA
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();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top