Committing days 1-4
This commit is contained in:
27
boilerplate.c
Normal file
27
boilerplate.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
// Get filename as an argument, defaults to "input.txt"
|
||||
char *path = (argc > 1) ? argv[1] : "input.txt";
|
||||
|
||||
if (!path)
|
||||
{
|
||||
printf("Requires input file.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
FILE *file = fopen(path, "r");
|
||||
|
||||
if (!file)
|
||||
{
|
||||
printf("Could not find file.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Code goes here
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user