int32_t was only introduced in C99. Indeed, it is often recommended to use int32_t instead of int, but usually only module export interfaces, network programming, and embedded programming have requirements for integer length. In other cases, there are no requirements. You can use int to keep the code simple, int is generally It is the type that can guarantee the fastest CPU speed. In particular, it is recommended to use uint8_t instead for unsigned char.
I don’t think there is much need to worry about abandoning int or not. Language provides the elements and norms for our use. It doesn't mean it's useless if you don't use it. If you don’t use it now, you may use it in the future. If you don’t use it, someone else may use it. If all ints are canceled now, how to maintain the previous software written with ints?
int8_t int16_t
requires stdint.h,int
is native.If some platforms (such as microcontrollers) do not have a stdint library, you can only use
int
int32_t was only introduced in C99. Indeed, it is often recommended to use int32_t instead of int, but usually only module export interfaces, network programming, and embedded programming have requirements for integer length. In other cases, there are no requirements. You can use int to keep the code simple, int is generally It is the type that can guarantee the fastest CPU speed. In particular, it is recommended to use uint8_t instead for unsigned char.
I don’t think there is much need to worry about abandoning int or not. Language provides the elements and norms for our use. It doesn't mean it's useless if you don't use it. If you don’t use it now, you may use it in the future. If you don’t use it, someone else may use it. If all ints are canceled now, how to maintain the previous software written with ints?