U
uche
can someone tell me if this is a correct way to writing a vector of
structure to a file...
will this write the contents of a vector into the file?
bool Cwrite (vector <struct> &write, const string & filename)
{
ofstream myfile (filename);
if (myfile.is_open())
{
myfile << write;
myfile.close();
return true;
}
else
{
cout << "Unable to open file";
return false;
}
}
structure to a file...
will this write the contents of a vector into the file?
bool Cwrite (vector <struct> &write, const string & filename)
{
ofstream myfile (filename);
if (myfile.is_open())
{
myfile << write;
myfile.close();
return true;
}
else
{
cout << "Unable to open file";
return false;
}
}