944,051 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 807
  • C++ RSS
Aug 31st, 2007
0

Closing a test File after writing in it

Expand Post »
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,

C++ Syntax (Toggle Plain Text)
  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.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Masood Ali is offline Offline
19 posts
since Mar 2007
Aug 31st, 2007
0

Re: Closing a test File after writing in it

Have you corrupted outFile prior to this attempt? The supporting code may contain your answer.
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004
Aug 31st, 2007
0

Re: Closing a test File after writing in it

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.
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Optomizing for Pentium Pro
Next Thread in C++ Forum Timeline: Need Book on Design Patterns





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC