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

51,766 answers

573 users

How to create short unsigned type for 64 32 16 and 8 bits variables in C

1 Answer

0 votes
#include <stdio.h>

typedef unsigned long long U64;
typedef unsigned int       U32;
typedef unsigned short     U16;
typedef unsigned char      U8;


int main() {

    U64 n_64 = 38465287346734;
    U32 n_32 = 4194967295;
    U32 n_16 = 5846529;
    U32 n_8 =  285;

    printf("%I64d\n", n_64); // gcc
    printf("%u\n",    n_32);
    printf("%u\n",    n_16);
    printf("%u\n",    n_8);

    return 0;
}




/*
run:

38465287346734
4194967295
5846529
285

*/

 



answered Apr 13, 2022 by avibootz

Related questions

...