you only allocate a pointer with this fspos_t* lastSegmentPos = 0;what you want is the memory for the structure to be allocated
fspos_t lastSegmentPos; // create space in memory for our structure
...
file.fgetpos(&lastSegmentPos); // pass the pointer to the structure to the function to get the position data
then lastSegmentPos should hold the position and cluster information.