Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,879 questions

51,805 answers

573 users

How to use integer types from stdint.h in C

1 Answer

0 votes
#include <stdio.h>
#include <stdint.h>

int main() {
    int8_t i8 = 127;
    int16_t i16 = 32767;
    int32_t i32 = 2147483647;
    int64_t i64 = 9223372036854775807;

    uint8_t ui8 = 255;
    uint16_t ui16 = 65535;
    uint32_t ui32 = 4294967295;
    uint64_t ui64 = 18446744073709551615;

    printf("%d\n", i8);
    printf("%d\n", i16);
    printf("%d\n", i32);
    printf("%I64u\n\n", i64);

    printf("%u\n", ui8);
    printf("%u\n", ui16);
    printf("%u\n", ui32);
    printf("%I64u\n", ui64);

    return 0;
}




/*
run:

127
32767
2147483647
9223372036854775807

255
65535
4294967295
18446744073709551615

*/

 



answered May 7, 2021 by avibootz
...