Reputation: 23
if ((fp = fopen(argv[2], "r")) == NULL){
printf("Failed to load file");
}
I'm pretty new to C, I'm not sure why this is producing an error. It's opening a new window and saying
unhandled exception error.
What does this error mean? I am using Visual Studio 2013
Complete program:
#include <stdio.h>
#include <string.h>
#pragma warning (disable:4996);
FILE * fopen(char *filename,char *access);
int main(int argc, char argv[]){
FILE *fp = NULL;
char fileContents[100] = { 0 };
if ((fp = fopen(argv[2], "r")) == NULL){
printf("Failed to load file");
}
}
Upvotes: 2
Views: 1812