To detect a null pointer error in TurboC 2 and Turbo C++ 3
Null Pointer error occur when a pointer which were pointed to a null
address location where used in writing or reading. Therefore when the program exits, it
will say null pointer error. It is very hard to detect this type of error using TC 2.0 or
TC++ 3. But there are ways to overcome this problem.
To detect this type of error you have to use try and error method. Place a exit()
statement in your suspected line. If the program exit at that line and there is no
indication that the error had occur, then move your exit() command further to the next
subsequent line and rerun your program. If there is error indicated therefore the error
must be on the previous line before the exit() statement. Check throughly on that section. |