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,950 questions

51,892 answers

573 users

How to use unsigned fixed-width integer type in C

2 Answers

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

int main(void)
{
    uint8_t ui8 = 255;
    uint16_t ui16 = 16000;
    uint32_t ui32 = 320000;
    uint64_t ui64 = 6400000;
    
    printf("%d\n", ui8);
    printf("%d\n", ui16);
    printf("%" PRId32 "\n", ui32);
    printf("%" PRId64 "\n", ui64);
}




/*
run:

255
16000
320000
6400000

*/

 



answered Apr 23, 2024 by avibootz
0 votes
#include <stdio.h>
#include <inttypes.h>

int main(void)
{
    uint_fast8_t ui8 = 255;
    uint_fast16_t ui16 = 16000;
    uint_fast32_t ui32 = 320000;
    uint_fast64_t ui64 = 6400000;
    
    printf("%d\n", ui8);
    printf("%ld\n", ui16);
    printf("%ld\n", ui32);
    printf("%" PRId64 "\n", ui64);
}




/*
run:

255
16000
320000
6400000

*/

 



answered Apr 23, 2024 by avibootz

Related questions

2 answers 164 views
1 answer 152 views
152 views asked Aug 24, 2017 by avibootz
1 answer 65 views
1 answer 106 views
1 answer 119 views
...