I have a C program that among many things I want it to read the input from a file and write it in another file. The problem with the input file and the output file is the same. Unless I write the whole path for the file, it does not recognize the fopen instruction.

I will include the piece of code so I can explain myself better: If I write:
PHP Code:
outfile fopen("UnifE-n51-k5""w");
fprintf(outfile,"a \t b \t ajuste \t media \n");
fprintf(outfile,"==================================\n"); 
nothing happens and the address for the outfile is NULL.
However if I give the entire path for the file
PHP Code:
outfile fopen("/Users/Marta/Documents/VRPStochastic/UnifE-n51-k5""w");
fprintf(outfile,"a \t b \t ajuste \t media \n");
fprintf(outfile,"==================================\n"); 
Works fine. I know I can do this all the time, but I do write a lot of code for my academic research and I don't want to remember the entire path for every program. Besides my colleague works on Windows and if I get part of his code I have to change it to adjust it to Xcode, which is a waste of time.

Thanks a lot for your help.