Please correct the example in the string library

While I am looking at the example at
http://www.cplusplus.com/reference/string/string/reserve.html
I have notice the code below

ifstream file ("test.txt",ios::in|ios::end);

This cause a compilation problem on cygwin g++ on window.
Can somebody please correct it to
ifstream file ("test.txt",ios::in);

Thanks
Alan Mehio
London,UK
It should be
1
2
3
ifstream file ("test.txt",ios::in|ios::ate);
//Or maybe
ifstream file ("test.txt",ios::in|ios::at);
to work correctly.
Last edited on
Topic archived. No new replies allowed.