So usually we do:
But this project we have to prompt for the filename. I've tried doing:Code:#define FILENAME input.txt
But it only scans in the first letter, which I somewhat expected. As far as I can tell, you can't do Strings in C, is this correct?Code:printf("Enter the name of the data file w/ extension: "); scanf("%c", &FILENAME);
If someone can please help me, what is the correct way to scan it in?
On a side note, when I'm opening the file with:
I get the warning:Code:FILE *inp; inp = fopen( FILENAME, "r" );
Not as big of a problem, but still an issue.Code:warning: passing arg 1 of `fopen' makes pointer from integer without a cast