Hi!
I am reading data from a text file into a dynamically constructed array, like this:
This works fine for arrays of float but does not work when I change the type to double? Any idea why, and how to fix it?Code:static const unsigned pN = 1 << 13; float *p = NULL; p = new float[ pN ]; // DATA FILE *file; file = fopen( "dist.txt" , "r" ); unsigned int i = 0; while( !feof(file) ) { fscanf( file, "%f", p[ i ] ); i++; } fclose(file);
Thanks for you help!
Serge