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 signed type for 64 32 16 and 8 bits variables in C

1 Answer

0 votes
#include <stdio.h>

typedef signed long long I64;
typedef signed int       I32;
typedef signed short     I16;
typedef signed char      I8;


int main() {

    I64 n_64 = 2846528734673;
    I32 n_32 = 1194967295;
    I32 n_16 = 4846529;
    I32 n_8 =  186;

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

    return 0;
}




/*
run:

2846528734673
1194967295
4846529
186

*/

 



answered Apr 13, 2022 by avibootz
...