If understand you and, the tutorial I just read basically I need a buffer
to read and pass the string the fopen. What is what I did here, unless I screwed up somewhere. The buffer 'filename' is the where the user inputs text, that text is passed to fopen, which reads the text and opens the file name.
Its compiles fine but when I run it, it will prompt for input, I put the input then, it pauses for a second then, I get this crash which I never seen before in programinng but its the crash you get when lets say, an applaciation you are running, stops working and you get this put up
xxxxxxx.exe has encountered a problem and needs to close . We are sorry for the inconvenience."
Could it be my complier, because it looks like it should've worked now? Heres the code, that part of the code.
Code:
char filename[BUFSIZ] = {100};
FILE *fp;
printf("\n\nType in the path and file name\n\n\n", filename);
fgets( filename, BUFSIZ, stdin );
fp = fopen( filename, "r" );