![]() |
|
#1
|
|||
|
|||
empty output fileDear all,
I am running a simulation program that should write some output to an output file. In fact, if I run my program with the number of iterations equal to 5,000 the program works fine. However, if I run it with 10,000 iterations, an empty output file is created. There is no error message saying that there is overload or lack of memory or something and my command window indicates in the usual way that the program finished running. Does anybody know what the problem could be? Thanks in advance and regards, Marjolein |
|
#2
|
||||
|
||||
|
Quote:
Please show us how you are writing to the file. Did you use ofstream or fstream to open the file for editing? What kind of data are you wtiting in it? Post some code, please. Regards, Luci __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#3
|
|||
|
|||
|
I just used cout << in the program and then typed the following in my command window to read from an input file and write to an output file:
repeated_simulation_extended_eff < input_het_n4_a05.txt > output_het_n4_a05_ex_eff.txt There should not be anything wrong with the code itself, since it works fine for 5,000 iterations. So I just wondered whether somebody recognized the situation... |
|
#4
|
||||
|
||||
|
Quote:
__________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#5
|
|||
|
|||
|
Quote:
|
|
#6
|
||||
|
||||
|
Quote:
__________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#7
|
|||
|
|||
|
Quote:
Thanks anyway for your reactions! |
|
#8
|
|||
|
|||
|
Quote:
The answer to your question is: Yes, it is possible for a program with a bug to terminate abnormally without any error messages. Sometimes the bug could cause problems with large numbers of iterations but would perform as advertised when the same program is run with fewer iterations. Since my programs rarely have bugs (a little joke, folks), I don't know if it happens often. I am always interested in cases like this, since, if there is some abnormal behavior under certain conditions and not under other conditions, there is either a bug or some program limitation that I would like to know about. Sweeping bugs under the rug (wow, what a metaphor) is not acceptable if the program is going to be used at some later time. If you only need output now, and you think your output is OK, it's your prerogative to ignore the bug. Only my opinion, of course. Regards, Dave |
|
#9
|
|||
|
|||
|
Thanks! I will check my program and output rigorously to find out whether it is a bug...
|
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 11:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
| using vector or array | oshiotse | C++ Forum | 4 | 16-Apr-2004 11:59 |
| Re: Programming Techniques | WaltP | C Programming Language | 0 | 10-Mar-2004 00:56 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The