Цикл, подобный следующему:
int type, stories;
while (fscanf(buildingFile, "%d %d", &type, &stories) == 2)
{
printf("Got type=%d, stories=%d\n", type, stories);
/* Do something with 'type' and 'stories' */
}
if (ferror(buildingFile))
{
perror("buildingFile");
}