GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 15-Sep-2004, 07:19
Marjolein Marjolein is offline
New Member
 
Join Date: Jun 2004
Posts: 25
Marjolein is on a distinguished road

empty output file


Dear 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  
Old 15-Sep-2004, 09:05
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 961
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Quote:
Originally Posted by Marjolein
Dear 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

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  
Old 15-Sep-2004, 09:19
Marjolein Marjolein is offline
New Member
 
Join Date: Jun 2004
Posts: 25
Marjolein is on a distinguished road
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  
Old 16-Sep-2004, 00:28
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,258
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by Marjolein
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...
Nope, not a clue, since we have no code to go on. Maybe you don't have enough memory to run the program ("lack of memory or something").
__________________

Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough.
-- Pearl Williams
  #5  
Old 16-Sep-2004, 02:44
Marjolein Marjolein is offline
New Member
 
Join Date: Jun 2004
Posts: 25
Marjolein is on a distinguished road
Quote:
Originally Posted by WaltP
Maybe you don't have enough memory to run the program ("lack of memory or something").
Does that happen more often? Because usually I get the message "Abnormal program termination" in these cases...
  #6  
Old 17-Sep-2004, 01:10
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,258
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by Marjolein
Does that happen more often? Because usually I get the message "Abnormal program termination" in these cases...
We'd really like to help you but you really need to stop asking questions and answer those that were asked of you. We have absolutely no idea what we're dealing with so we cannot give you an answer. Read the responses you've already received and respond to the requests. Once we know what you are trying to do, we can help you fix the problem.
__________________

Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough.
-- Pearl Williams
  #7  
Old 17-Sep-2004, 02:57
Marjolein Marjolein is offline
New Member
 
Join Date: Jun 2004
Posts: 25
Marjolein is on a distinguished road
Quote:
Originally Posted by WaltP
We'd really like to help you but you really need to stop asking questions and answer those that were asked of you.
I was asking just one question: whether anybody happens to recognize the situation that in some cases a program does not give any output without returning any error message. Since nobody seems to do so, I tried to avoid the problem by decreasing the number of iterations in part of the program and this worked out well. So my question is not very urgent anymore and I do not need to bother you with (very many) pages of code...
Thanks anyway for your reactions!
  #8  
Old 17-Sep-2004, 09:55
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,791
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold
Quote:
Originally Posted by Marjolein
I was asking just one question: whether anybody happens to recognize the situation that in some cases a program does not give any output without returning any error message. Since nobody seems to do so, I tried to avoid the problem by decreasing the number of iterations in part of the program and this worked out well. So my question is not very urgent anymore and I do not need to bother you with (very many) pages of code...
Thanks anyway for your reactions!

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  
Old 17-Sep-2004, 10:10
Marjolein Marjolein is offline
New Member
 
Join Date: Jun 2004
Posts: 25
Marjolein is on a distinguished road
Thanks! I will check my program and output rigorously to find out whether it is a bug...
 
 

Recent GIDBlogPython ebook by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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

All times are GMT -6. The time now is 03:22.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.