4 void set_calories(int* current, int* highest) {
5 if (*current > *highest) {
19 int current_calories = 0;
20 int highest_calories = 0;
23 while ((characters = getline(&buffer, &bufsize, stdin)) != -1) {
26 buffer[characters] = 0;
28 if (characters == 0) {
29 set_calories(¤t_calories, &highest_calories);
32 current_calories += atoi(buffer);
35 set_calories(¤t_calories, &highest_calories);
36 printf("The elf with the highest calories has %d calories", highest_calories);