I am trying to create an array from the integers that a user inputs. They must be inputted on the same line, e.g. 5 1 2 3 1 6. The number of integers can be any amount.
However, the first number + 1 determines the size of the array. E.g. if the user inputs the number 5 first, it must be followed by 5 other random integers thus making the length of the array 6. I'm getting confused on how to do this because there is so much user input. Thanks in advance!
Here is my code so far, though i don't think it'll be much help:
#include <stdio.h>
int main(void) {
int arr_days[13];
int i = 0;
printf(" ");
while(i < 13) {
scanf("%d", &arr_days[i]);
i = i + 1;
}
printf("%d", arr_days[0]);
return 0;
}