C++ vs Objective-C – Difference Between UInt8 and uint8_t

c++objective-c

What is the differnce between UInt8 and uint8_t, or UInt16 and unit16_t?

What does the _t imply?

Best Answer

In C99 the available basic integer types (the ones without _t) were deemed insufficient, because their actual sizes may vary across different systems.

So, the C99 standard includes definitions of several new integer types to enhance the portability of programs. The new types are especially useful in embedded environments.

All of the new types are suffixed with a _t and are guaranteed to be defined uniformly across all systems.

For more info see the fixed-width integer types section of the wikipedia article on Stdint.

Related Question