Q:

What's the difference between `typedef struct X { }` and `typedef struct { } X`?

What's the difference between these two declarations in C:  
typedef struct square{

   //Some fields

};

and
typedef struct{  

           //Some fields

} square;

A:

The first declaration:
typedef struct square {
    // Some fields
};

defines a type named struct square. The typedef keyword is redundant (thanks to HolyBlackCat for pointing that out). It's equivalent to:
struct square {
   //Some fields
};

(The fact that you can use the typedef keyword in a declaration without defining a type name is a glitch in C's syntax.)
This first declaration probably should have been:
typedef struct square {
    // Some fields
} square;

The second declaration:
typedef struct {
    // Some fields
} square;

defines an anonymous struct type and then gives it the alias square.
Remember that typedef by itself doesn't define a new type, only a new name for an existing type. In this case the typedef and the (anonymous) struct definition happen to be combined into a single declaration.

