Ignoring why I would want to do this, just trying to understand what is happening here: This code compiles:
#include
typedef char byte;
int
Edit here: (misunderstand of the question)
When you declare a variable in C it does not look for typedef
structures to see if a structure named the same with the variable. On the first code,
byte var_byte;
this line of code comes before the declaration of the variable int byte
. The computer will look for the most recent reference of the word byte as it was the structure name here.
On the second one the the variable int byte
does not return an error because you can still create variables with the same structure type name in C. But after you do so you can't create new structures to that structure as the computer will think that it is referring to the variable name and not the the structure type as the variable was declared most recently