zrobilem to mniej wiecej tak:
// Read G components from Data file from position XYH
bool cGData::ReadData(unsigned int X, unsigned int Y, unsigned int H, stGComponents * Data)
{
if (isOpen())
{
long DataOffset = (H * TotalGridSize + Y * YGridSize+ X) * sizeof(stGComponents);
int Result = fseek(DataIn, (DataStart + DataOffset), SEEK_SET);
if (Result)
{
printf ("ERROR -> Data read form File -> ErrorNr = %d\n", Result);
return false;
}
fpos_t DataPos;
if (fgetpos(DataIn, &DataPos))
{
printf("Error -> fgetpos()\n");
return false;
}
else
; // printf ("Read data At %4d\t", DataPos );
fread(Data, sizeof(stGComponents), 1, DataIn);
return true;
}
return false;
}
moze komus sie przyda.