What is the difference between the int types int8_t, int_least8_t and int_fast8_t?
What is the difference between the int types int8_t , int_least8_t and int_fast8_t ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The difference is defined in the sections of the C99 standard that Carl Norum quoted. But it may be useful to have an example.
Suppose you have a C compiler for a 36-bit system, with
char= 9 bits,short= 18 bits,int= 36 bits, andlong= 72 bits. Thenint8_tdoes not exist, because there is no way to satisfy the constraint of having exactly 8 value bits with no padding.int_least8_tis a typedef ofchar. NOT ofshortorint, because the standard requires the smallest type with at least 8 bits.int_fast8_tcan be anything. It’s likely to be a typedef ofintif the “native” size is considered to be “fast”.