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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

storing a class to a File

Status
Not open for further replies.

magezi

Programmer
Mar 2, 2000
118
UG
In ordinary C one can decalre a structure and store data from a structure into a file,simply using the fwrite() function.
How can one store datavalues from a class to a file?
eg

class acchart{
public:
char acno[10],acname[20],actype[10];
}

I want to store Five account numbers in a file each having:
Account Number Field, Account Name and Account Type

You could also give me code for retrieving this information from the file.

Thanx People
Nkabirwa Sowed Magezi
nkabirwa@netscape.net

A Ugandan Developer for

(1) School Management Information System(SMIS) - Foxpro 2.6 ; Ms-Acess 97

(2)Debt onitoring System(DMS) - Ms-Acess 97

(3) The Loans Recovery System(LS) - Ms- Access 97

(4) The Dry Cleaners System(DS) - Ms- Access 97
 
Well, if you know C than you can use absolutely the same fwrite(), it works on C++ too.
If you want to do it in C++, you may want to document yourself on stream libraries: iostream, ostream, fstream etc. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top