readfile with cli arg

This commit is contained in:
Christoph J. Scherr 2023-09-18 14:58:57 +02:00
parent b9b41be2f4
commit 23622a79ec
1 changed files with 6 additions and 2 deletions

View File

@ -1,9 +1,13 @@
#include <stdlib.h>
#include <stdio.h>
int main(void)
int main(int argc, char** argv)
{
char filename[] = "file.txt";
if (argc != 2) {
printf("usage: %s FILE", argv[0]);
exit(1);
}
char* filename = argv[1];
char buf[2];
FILE *fp;