Jour 1 : corps de la fonction main
This commit is contained in:
parent
1935cbac15
commit
e3dfee46d6
1 changed files with 16 additions and 2 deletions
18
src/main.c
18
src/main.c
|
@ -1,6 +1,20 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#define INPUT_FILE_PATH "./input.txt"
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
printf("Hello world!\n");
|
unsigned int calibration_sum;
|
||||||
return 0;
|
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;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue