I've been trying to read a data file with the following lines of code, but it doesn't ever start to read any and I don't know what's the problem:
#include <stdio.h>
#include <stdlib.h>
main()
{
FILE * entrada, * salida;
double *x, *y;
double *z;
int i=0,j=0,n=0;
entrada=fopen("salidaIntegral.txt", "r");
salida=fopen("Integral.txt", "w");
fscanf(entrada,"%lf %lf", &x[i], &y[i]);
printf("%lf %lf\n", x[i], y[i]);
i++;
while(feof(entrada)!=0)
{
fscanf(entrada, "%lf %lf", &x[i], &y[i]);
printf("%lf %lf\n", x[i], y[i]);
i++;
}
The .txt file is in the same folder as the .c file.