I'm trying to create an array of doubles, and I know I can do it like this,
double a[200];
but why can't I create one like this?
int b = 200;
double a[b];
It does not work.
Can anyone help me?
UPDATE:
int count;
count = 0
while (fgets(line,1024,data_file) != NULL)
{
count++;
}
double *x = (double *)malloc(count * sizeof (double));
double xcount = 1.0;
for (int i = 0; i < count; i++)
{
x[i] = xcount/f;
xcount = xcount + 1.0;
printf("%lf\n", x[i]);
}