It is the reason of program crashing, because when you assign your pointer with file, using fopen() system closes previous connection to this file. So when you try to use it later, you get crash.
Code:
........ f1=fopen(); f2=fopen();//after this f1 points to nowhere ........
Leave a comment: