Why should we typedef a struct so often in C?

As Greg Hewgill said, the typedef means you no longer have to write struct all over the place. That not only saves keystrokes, it also can make the code cleaner since it provides a smidgen more abstraction. Stuff like becomes cleaner when you don’t need to see the “struct” keyword all over the place, it looks more … Read more

Why should we typedef a struct so often in C?

As Greg Hewgill said, the typedef means you no longer have to write struct all over the place. That not only saves keystrokes, it also can make the code cleaner since it provides a smidgen more abstraction. Stuff like becomes cleaner when you don’t need to see the “struct” keyword all over the place, it looks more … Read more

uint8_t vs unsigned char

It documents your intent – you will be storing small numbers, rather than a character. Also it looks nicer if you’re using other typedefs such as uint16_t or int32_t.