"Moonlit" <news moonlit xs4all nl> wrote in message
Please don't top-post. Place responses after (or interspersed with) what
you're responding to. [re-arragned]
It's a member of std::string. Look it up.
int main()
What's "ofile"?
Ron, you didn't say where to add that. But better, in such a simple case,
would be to add the std:: specifiers where needed, or to add using
statements for the specific std:: items that will be used.
But, there's more here wrong than just that.
What's "ofile"? It's not defined. I'm guessing it's supposed to be a
std::string, given the use of c_str(), but I don't see it declared as such
anywhere. And the <string> header needs to be included if using strings.
Also, the string needs to get its content filled somehow, such as by using
std::cin.
If this was an attempt at reducing what you're posting, you cut out too
much. Read the FAQ, at
http://www.parashift.com/c++-faq-lite/ (especially
section 5, reagarding how to post here for best results).
And if you're getting errors you don't understand, post the error message
(the text; error numbers mean nothing for people using other compilers), and
tell us which line of code generates the error.
Lastly, most of us probably don't have the book referred to in your subject
line. Make your subject lines more specific to the problem (such as "error
using c_str()" or "how do I use c_str()?"). In the body of your message,
you can refer to the book you're getting an example from (but don't expect
we'll all have that book).
-Howard