I did this program, where I declared
long double *M;
Then I read the data from a file
i=1;
M = (long double *) calloc ( i , sizeof(long double) );
while ( !feof( arq_matriz ) ){
fscanf ( arq_matriz , "%Lf" , (M+i-1));
i++;
M = (long double *) realloc ( M , i * sizeof(long double) );
}
fclose(arq_matriz);
So, to test I print it on the screen
for (i=0;i<=44;i++){
printf("\n %Lf",*(M+i));
}
all perfect. But when I passed it for a function or even when I debug it I've got *M=0 while the truth *M = 0.25 and *(M+1) = 'invalid float number'. I don't know why this is happening since everything was printed right on the screen. Any hints? Thanks!