int counts[0]; // This declares an array that holds ZERO elements! No place to store a value.
int numbers[] = {1,2,3,4,5,6,7,8,9,10};
for(int i = 0; i < 10; i++)
counts[0] += numbers[i];
printf("%d ", counts[0]);
Чтобы исправить это:
int counts = 0; // Declare a variable, and start it at 0
int numbers[] = {1,2,3,4,5,6,7,8,9,10};
for(int i = 0; i < 10; i++)
counts += numbers[i];
printf("%d ", counts);