How to use unsigned int that is the correct size for your platform in C

2 Answers

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

int main(void) {
    uint_least32_t n = 1092834; // typedef unsigned int

    printf("%d", n);

    return 0;
}




/*
run:

1092834

*/

 



answered Mar 15, 2023 by avibootz
0 votes
#include <stdio.h>
#include <stdint.h>

typedef uint_least32_t uint32;

int main(void) {
    uint32 n = 1092834; // typedef unsigned int

    printf("%d", n);

    return 0;
}




/*
run:

1092834

*/

 



answered Mar 15, 2023 by avibootz

Related questions

...