So I was trying to get the size of a struct on my C program and write the following code:
typedef struct Msg_Header Msg_Header; // the struct Msg_Header was defined earlier
int size = sizeof Msg_Header;
This produced a compilation error I cant understand. In order for this to work I found that I must user parenthesis like that:
int size = sizeof(Msg_Header);
This is weird since sizeof works perfectly on simple variable types like int without parenthesis, same weird behaviour accures when I use struct Msg_Header instead if the alias.
Can someone explain what is going on here?
EDIT: The compilation error says: "expected expression before Msg_Header"