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

2 Answers

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

int main(void) {
    uint8_t n = 255; // typedef unsigned char

    printf("%d", n);

    return 0;
}




/*
run:

255

*/

 



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

typedef uint8_t uint8;

int main(void) {
    uint8 n = 255; // typedef unsigned char

    printf("%d", n);

    return 0;
}




/*
run:

255

*/

 



answered Mar 14, 2023 by avibootz

Related questions

2 answers 177 views
1 answer 194 views
1 answer 268 views
1 answer 163 views
163 views asked Jul 4, 2020 by avibootz
...