Subj : Re: fstream arrays To : borland.public.cpp.borlandcpp From : "D Kat" Date : Wed Feb 25 2004 04:25 pm The error (and I have stepped through this as well) is done within the function get_subj_fp - I have taken out the error check on the return of the function because it doesn't matter - what I'm saying is ignore the fact that I don't care if I get an error or not. That is not the point. In my way of veiwing the world Arrays are pointers. That is how I refer to them. This is what I care about if(!out_files[i]) ...... tests as 1 or as an ERROR if(!out_file).... tests as 0 or NOT ERROR. ofstream outfiles; vs ofstream outfiles[3]; Why does one return false while the other doesn't - BOTH successfully open, write and save. " Bruce Salzman" wrote in message news:403d0e80$1@newsgroups.borland.com... > > > the file open is called only once for any given item of the array (which > is > > when the " if (!out_files[file]) error is declared), the data is written > at > > the end of the program (successfully), and the files are closed > sucessfully. > > Not sure what the error is. Have you examined ios::state to see which bits > are set? > > > The program works without any error at all when I do NOT declare the > fstream > > variable to be an array and when I do open the fstream as array items it > > does actually open a file even though it claims to be returning a 0 when > > checked. > > What returns 0? get_subj_fp() returns 0 on success. open() doesn't return > anything. > > > I have lived with this for some years but am now having a similar > > enough problem in the GUI domain that I need to understand how arrays of > > stream pointers differ from streams. > > Your code doesn't have arrays of stream pointers. You declare an array of > stream objects. > > Regards, > Bruce > > .