c++ ifstream problem with gcc 3.2

Zhabitsky Oleg-QOZ001 Oleg.Zhabitsky@motorola.com
Thu Dec 19 05:44:00 GMT 2002


Hello Gerrit,

I've faced the same problem after installation gcc 3.2.
How I solved it in my program:

      ifstream cur_stream(file_name1, ios::in);
      ......
      cur_stream.close();
      cur_stream.clear();
      cur_stream.open(file_name2, ios::in);
      ....

Hope, it'll help you.

Best regards,
Zhabitsky Oleg

> 
> Hello,
> 
> I recently encountered the problem with the gcc 3.2 compiler 
> of cygwin 
> using ifstream. Basically it is the same problem as mentioned in 
> http://gcc.gnu.org/ml/gcc-help/2002-06/msg00079.html although 
> this is about 
> gnu cc 3.0. I thought that this was already fixed. The 
> problem is that when 
> a ifstream object is closed and than reopened with the open 
> method to open 
> another file, no data is returned. But if one uses 2 ifstream 
> objects, 
> everything works perfectly. Is this a known issue with c++ on cygwin ?
> 
> Gerrit.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list