Hi.
I set a programs' argument (MENU Project > Set programs' argument... ) and specified a file name (test.txt) for debug mode.
But when i try to open that file (yes, it exists in debug folder), i get a null value.
#include <stdio.h>
#include <stdlib.h>
void read_source_file( char * filepath );
int main( int argc, char **argv )
{
read_source_file( argv[1] );
exit(EXIT_SUCCESS);
}
void read_source_file( char * filepath )
{
FILE *f = fopen( filepath, "r" );
if ( f == NULL )
{
printf("File not found [%s]!", filepath ); // OUTPUT: "File not found [test.txt]!"
}
else
{
}
}
Help?
PS: if i drag the file on my .exe it works. It just dont work using that IDE option.