Should I use types C (uint8_t /.../ uint64_t) or (u_int8_t /.../ u_int64_t)?

My GNU-Linux platform (debian stretch) has the C types u_int8_t , u_int16_t , u_int32_t and u_int64_t defined in the sys/types.h file, and uint8_t , uint16_t , uint32_t and uint64_t defined in stdint.h . I found these types useful in learning how to assemble X86-64 assembler and interacting with C. Is there any reason why I should prefer one header file over another (be it "best practice", portability, etc.)? . Is the answer different for C ++?

+5
source share
1 answer

stdint.h is the C standard that maps to cstdint in standard C ++.

sys/types.h not portable C.

+10
source

Source: https://habr.com/ru/post/1265830/


All Articles