Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!rutgers!usc!ucsd!sdcc6!sdcc10!cs161fdu From: cs161fdu@sdcc10.ucsd.edu (Don't crash sdcc10) Newsgroups: comp.lang.c Subject: fopen Message-ID: <6307@sdcc6.ucsd.edu> Date: 21 Jan 90 01:03:39 GMT Sender: news@sdcc6.ucsd.edu Organization: University of California, San Diego Lines: 32 I have a question: Is there a reason why fopen will not work in my subroutines that are in a different file? fopen works when it is contained in the main program, but when I put a routine containing fopen in a separate file, statements coming after the fopen statements are never reached. Once fopen is reached, the routine seems to start over again. I've check the code and everything is correct to my knowledge. Is. File roughly looks like this: int function() { . . . FILE *fp; fp=fopen("Anyfile","r"0;); //where "Anyfile" can be anyfile: ie. test.data . . . return something; } The problem is that program execution does not go past fp=fopen(....). The code is the exact same code in the main routine, so it should work. I've tried playing with it, but no success. Any help would be appreciated... Gary (cs161fdu)