I'm looking for help reading a binary file in the most efficient way (fast). Here is the C-code. Thanks.
#define MAX_LAYERS 100
typedef struct
{
char string[1000];
} STRINGARRAY_STRUCT;
typedef struct
{
double rangeFinals;
double crossFinals;
STRINGARRAY_STRUCT time[MAX_LAYERS]; // Sample: xx:xx:xx
double dir[MAX_LAYERS]; // degrees
double speed[MAX_LAYERS]; // knots
int flagSpeed[MAX_LAYERS]; // flag speed
int flagDir[MAX_LAYERS]; // flag direction
int flagTime[MAX_LAYERS]; // flag time
int percentTraversed;
int year[MAX_WIND_LAYERS];
int jDay[MAX_WIND_LAYERS];
} CURRENT_STRUCT;
typedef struct
{
char string[1000];
} STRINGARRAY_STRUCT;
int main (int argc, char **argv)
{
FILE *fp;
CURRENT_STRUCT winds;
fp = fopen (FileName, "rb");
if (fp != NULL)
{
fread (&winds, sizeof(CURRENT_STRUCT), 1, fp);
fclose (fp);
}
}