Jour 1 : corps de la fonction main

This commit is contained in:
Hippolyte Chauvin 2023-12-03 17:06:46 +01:00
parent 1935cbac15
commit e3dfee46d6

View file

@ -1,6 +1,20 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#define INPUT_FILE_PATH "./input.txt"
int main(int argc, char *argv[]) {
printf("Hello world!\n");
return 0;
unsigned int calibration_sum;
FILE *input_file;
input_file = fopen(INPUT_FILE_PATH, "r");
if (input_file == NULL) {
fprintf(stderr, "Error %d opening \"%s\".", errno, INPUT_FILE_PATH);
return errno;
}
calibration_sum = get_calibration_sum(input_file);
return EXIT_SUCCESS;
}