Subj : Re: fstream arrays To : borland.public.cpp.borlandcpp From : "Ray Sittig" Date : Wed Feb 25 2004 01:52 pm DKat, 1. Is 20 characters enough for name? You don't show what sub_name or cdn actually is. 2. I would suspect you're trying to open a file that's already open. Where do you close the file? Ray Sittig > /////////////////////CODE//////////////////////////////// > ofstream out_files[NSUB];//file to write data to > get_subj_fp(int file) > { > char name[20]; > > strcpy(name,"data/"); > strcat(name, sub_name[file]); > strcat(name,"."); > strcat(name,cdn); > out_files[file].open(name); > if (!out_files[file]) > { > cerr << "\nerror on file " << sub_name[file] << "\n"; > return(1); > } > return(0); > } > > .