プログラムは Linux でコア ダンプを生成しますが、Windows では正常に動作します。理由はありますか?
#include <stdio.h>
int main() {
int i, n;
int count[n];
int total;
int value;
int d;
printf("Enter the length of array: ");
scanf("%d", &n);
//printf ("total of array is %4d \n", n);
for (i=0; i<=n-1 ; i++ ) {
printf("Enter the number %d: ", i);
scanf("%d", &count[i]);
// printf ("total of array is %4d \n", n);
}
//printf ("total of array is %4d \n", n);
value = totalcalc( count, n);
printf ("total of array is %3d \n", value);
scanf ("%d", &d);
}
int totalcalc(int count1[], int j)
{
int i, total, value;
//printf (" Entered into function, value of j is %d \n", j);
value = 0;
for (i=0; i<=j-1;i++ ) {
value = value + count1[i];
//printf ("the value is %d\n", value);
}
return value;
}