Hallo...
ich hätte da eine Frage... warum funktioniert mein Programm wenn ich den arrey x[2000] stelle... und wenn ich x[1000] stelle funktioniert nichts nicht... jemand ne logische Erklärung für mich parat?
ich hätte da eine Frage... warum funktioniert mein Programm wenn ich den arrey x[2000] stelle... und wenn ich x[1000] stelle funktioniert nichts nicht... jemand ne logische Erklärung für mich parat?
Code:
#include<stdio.h>
#include<stdlib.h>
int read_ints(int a[], int dim)
{
int i;
for (i=1;i<dim;i++)
{
printf("a[%d]:",i);
scanf("%d", &a[i]);
if (a[i] == 0)
{
printf("Programm wird beendet!!!!!\n");
break;
}
}
}
int main()
{
int x[2000];
int d;
printf("dim?");
scanf("%d",&d);
read_ints(x,d);
}