Skip to content

Commit

Permalink
test if file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
oioki committed Dec 1, 2023
1 parent ddaba5f commit 210c9f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 01/01.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ int main(int argc, const char* argv[]) {
}

FILE * f = fopen(argv[1], "r");
if (f == NULL) {
printf("Error opening file: %s\n", argv[1]);
return 2;
}

char s[100];

int result = 0;
Expand Down

0 comments on commit 210c9f7

Please sign in to comment.