Should I use stdint.h types?

Sam Stuewe samuel.stuewe at gmail.com
Fri Jan 24 03:07:13 UTC 2020


Joe,

You should use the type that makes sense for what you want.

If, what you want is a signed integer that is between (inclusive) short and long in size, you want an int. If you want/need an integer that is exactly 32 bits large, you want an int32_t.

Technically, the older versions are more portable, where the specific versions make requirements more clear. Use the one that matches your intentions and goals.

Personally, I think the fast/least variants are incredibly cool and are one of my favorite features missing from newer languages that are trying to be lower-level.

All the best,

-Sam


More information about the Friends mailing list