尝试创建结构的二维动态数组时出错

I have to create a 2D dynamic array of structures and read those structures from a binary file. The compiler gives me the following error: "error: incompatible types when assigning to type 'S_Apartament {aka struct <anonymous>}' from type 'size_t {aka unsigned int}'"., when trying to access the elements of the array. Code:

FILE *f;
    f = fopen("Block.bin", "rb");
    if(f == NULL)
    {
        printf("Error opening file");
        fclose(f);
        exit(1);
    }
    S_Apartament Flats;
    unsigned int floor=0, flats_per_floor=0;
    fread(&floor,sizeof(unsigned),1,f);
    fread(&flats_per_floor,sizeof(unsigned),1,f);
    S_Apartament **ptr = (S_Apartament **)malloc(sizeof(S_Apartament*) * floor);
    for (int i = 0; i <  floor; i++)
    {
        ptr[i] = (S_Apartament *)malloc(sizeof(S_Apartament)*flats_per_floor);
    }
    for(int i = 0; i <  floor; i++)
    {
        for(int j = 0; j < flats_per_floor; j++)
        {
            ptr[i][j]=fread(&Flats,sizeof(S_Apartament),1,f);
        }
    }
fclose(f);

任何帮助,将不胜感激!