running stops and Microsoft Window pop up with message:
microsoft c ++ stop working. you can
debug online
close the program
....
I am using stringstream to open a output file, write data in, and close it.
I have similar output function to write title into the same output file by 'myfile'. it has no problem.
I also delete the massive calculations in code to simplify this C code. it turns out work. but when I add computation back. it stop.
Maybe some more code will help diagnose, you mentioned you do this in another function, are you opening and closing the file there as well? Is fout() only called if the file has been successfully opened?
long Rtime[someNumber] //Is this how Rtime is defined? same for velocity?
I am using stringstream to open a output file
Do you mean you are using a stringstreams str() function with c_str() to convert to const char * to open the file?
my situation is too complicated. I defined Rtime/ velocity by
double Rtime[6000], velocity[6000];
there is really no error. I don't even know where is the problem make it stop.
the only thing I know is that it stop running at this fout () function.
but when I delete some computation code. it works again.
I have 'myfile' defined globally before main() function:
stringstream myfile;