I have included <string> and am trying to write out to a file but am getting some strange error messages.
my code:
f.write(current->text);
what should I change, or use?
This is a discussion on writing files using "string" within the C++ Programming forums, part of the General Programming Boards category; I have included <string> and am trying to write out to a file but am getting some strange error messages. ...
I have included <string> and am trying to write out to a file but am getting some strange error messages.
my code:
f.write(current->text);
what should I change, or use?
A string has a member function, c_str(), which returns a char *. Try that.
Thanks.
I'll give it a go shortly, I'm just presently adding code to add an animal to my animal game. (a uni assignment)
Mike![]()