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,

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.

Recommended Answers

All 2 Replies

Have you corrupted outFile prior to this attempt? The supporting code may contain your answer.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.