typedef vs #define

#define is a preprocessor directive that defines a macro.
typedef is used to create a new type name.
#define does not create a new type, but simply replaces all occurrences of the macro name with the given value.
typedef creates a new type name to be used as an alias for the specified data type.