How does the c compiler execute when we include a pointer declaration to a structure which we haven't finished defining yet?

Solution 1:

All pointers to structures in a C implementation are the same size as each other, per C 2018 6.2.5 28:

… All pointers to structure types shall have the same representation and alignment requirements as each other…

So, to know how big a pointer to a structure is, the compiler does not need to know anything about the structure, just that the pointer is pointing to some type of structure.