Closing a test File after writing in it

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2007
Posts: 19
Reputation: Masood Ali is an unknown quantity at this point 
Solved Threads: 1
Masood Ali's Avatar
Masood Ali Masood Ali is offline Offline
Newbie Poster

Closing a test File after writing in it

 
0
  #1
Aug 31st, 2007
Hi All.
I am developing a C++ application which has a module to read data from a text file and then write some its data into another text file and then save that.
Everything goes right tilll the last line of the program when I end up writing and try to close the file as follows,

  1. fclose(outFile);

the following error comes out.
General Protection exception
0x24E7:0x54F3
[TEST1]0x24E7:0x54F3 processor Fault

Where test is the name of folder I ahave placed both the files in.
I am using Visual IDE of
Turbo C++
Version 4.5

Thanks.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,361
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 240
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Closing a test File after writing in it

 
0
  #2
Aug 31st, 2007
Have you corrupted outFile prior to this attempt? The supporting code may contain your answer.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Closing a test File after writing in it

 
0
  #3
Aug 31st, 2007
Well there's nothing wrong with that line, so it must be something else.

My guess is that you've trashed memory somewhere else in your program, and this just happens to be where you find out. It could have crashed at any other line as well, and then no doubt you would have posted that line instead.

To make any real progress of diagnosing the problem, you would need to post the whole program.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC