The only thing i didnt understand was the addition of the "argument stuff" i dont think im familiar with those commands.
You can call your program from the dos prompt and pass it arguments. Those arguments can be used from the parameters to main, argc and argv. If you call your program like this:
Code:
C:\>prog.exe testfile.txt
argc will be 2 and argv will be an array of strings that looks like
Code:
{"prog.exe","testfile.txt",NULL}
and you can get to the test file with argv[1]. The best way is to experiment with different ways of calling your program and with different files to see how your OS handles dos arguments, but the easiest way to get it right the first time is to hard code an absolute path to the file you want:
Code:
int main( void ) {
  FILE *fp = fopen( "C:\\worker\\testfiles\\test.txt", "r" );
Do i need to make a .txt file in the same directory?
If you use a relative path the file probably has to be in the same directory as the program's exe unless you've added the program to a path environment variable, then the current working directory has to be the same directory that the test file is in.