B
babakandme
Hi to every body...
I'm a novice C++ programmer & I've a question,
How can I write a class as follow to a file...
Class A
{
public:
// Accessors Methods...
.
.
.
private:
int itsAge;
string itsName;
// char itsName[ 80 ];
};
I know that, I should use ofstream &....
but there is a problem:
"itsName" is a "string or char*" & It can not be written in desired
file...
Should I write a self writting method for this class to write itself
to a file or what?
thanks in advance...
I'm a novice C++ programmer & I've a question,
How can I write a class as follow to a file...
Class A
{
public:
// Accessors Methods...
.
.
.
private:
int itsAge;
string itsName;
// char itsName[ 80 ];
};
I know that, I should use ofstream &....
but there is a problem:
"itsName" is a "string or char*" & It can not be written in desired
file...
Should I write a self writting method for this class to write itself
to a file or what?
thanks in advance...