I'm trying to read an array from a file and then to assign these values to another array. I get a lot of zeros and really big numbers.
I've tried different specifiers but they are still the same. when there is no assignment and only one array is printed, there is no such a problem
int n;
FILE * fo;
fo = fopen("f1.txt","r");
double complex mas[8];
double complex y[8];
int N = 0;
while (!feof(fo)) {
fscanf(fo, "%lf", &mas[N]);
printf("%lf ", mas[N]);
N++;
printf("%d ", N);
}
fclose(fo);
printf("\n N=%d\n", N);
for(n=0; n<N; n++)
{
y[n] = mas[n];
printf("%f %f\n", y[n], mas[n]);
}
looks like the values are being assigned but 1st array can't be printed