34
35
36
37
38
39
40
41
42
43
44
45
|
exit(EXIT_FAILURE);
}
// read data from dataname into input
char *input = NULL;
size_t ilen = slurp(&input, dataname);
// call the right function
void (*p)(char *, size_t) = aocselect(y, d);
if (p) p(input, ilen);
else fprintf(stderr, "Impossible!\n");
free(input);
}
|
|
|
34
35
36
37
38
39
40
41
42
43
44
45
|
exit(EXIT_FAILURE);
}
// read data from dataname into input
char *input = NULL;
size_t ilen = slurp(&input, dataname);
// call the right function
aocfunc *p = aocselect(y, d);
if (p) p(input, ilen);
else fprintf(stderr, "Impossible!\n");
free(input);
}
|