Gettting the string form iterator to be written to an ascii file

I have a list<string>.
Using the iterator I can get *i.
Now I want to use the string 'pointed' how ?

I dont want to use cout to console I want to do my_string=*i. Must I use pointers and so... ?
Thanks
Last edited on
 
my_string=*i


All you need.
(excuse me for re-ask the question)
I have an ofstream , and I want to write to an ascii file the string contained into the list.

file_out.put(*i); this fails,

How can do it ?
Last edited on
http://www.cplusplus.com/reference/iostream/ostream/put/

ofstream.put() takes a char as argument, not a string. Use ofstream << *i;
Topic archived. No new replies allowed.