Hello Ashish! On Tue, Sep 21, 2004 at 12:58:43PM -0700, Ashish Lakhani wrote: > void ALCload(FILE * infile) > { > istream *iptr; > stdiobuf p_buf (infile, ios::in); > istream istr (&p_buf); > iptr = &istr; > ALCload(iptr); > return; > } > I guess new code should work in similar fashion as earlier one. Yes, I think it's OK. Although I would probably eliminate the iptr variable altogether. > However there is another piece of code which is not giving problems > if(fptr->open(strPtr, std::ios::in | std::ios::out | std::ios::nocreate) > == 0) > > gcc gives following error `nocreate' is not a member of type > `std::basic_ios<char, std::char_traits<char> >' > > and also fptr->sync(); > gives error > /usr/include/c++/3.2.3/fstream:191: `int > std::basic_filebuf<_CharT,_Traits>::sync() [with _CharT = char, _Traits > = std::char_traits<char>]' is protected > > I was wondering if anyone has faced similar compiler problems in past > and any they any workaround/solutions they might want to suggest. Indeed, there already was someone facing the same problem with "nocreate" even on this mailing list: http://gcc.gnu.org/ml/gcc-help/2002-09/msg00219.html I have no idea how to solve the other problem. Maybe if you elaborate on that and explain in more detail why you need to call sync()? -- Claudio