-2

I found this line of code and I didn't understand how can you typedef a uint8 to something that isn't a type in the first place like x[4]? What is really meant here ? Is it an just an array of 4 uint8 type variables and that is just another way of saying it?

Code:

Typedef uint8 x[4]
Sourav Ghosh
  • 133,132
  • 16
  • 183
  • 261
  • This code compiles but gives error if I try to use the alias. Probably because the compiler defines the token as an alias. but this is an illegal keyword. – rsonx Dec 24 '18 at 11:39

1 Answers1

2

The syntax of a typedef matches the syntax of a declaration. In this case, x is a type alias for uint8[4].

Vittorio Romeo
  • 90,666
  • 33
  • 258
  • 416