What type sizes does your system use? - C Data Type

C examples for Data Type:sizeof

Description

What type sizes does your system use?

Demo Code

#include <stdio.h>

int main(void)
{

    printf("Type int has a size of %zd bytes.\n", sizeof(int));
    printf("Type char has a size of %zd bytes.\n", sizeof(char));
    printf("Type long has a size of %zd bytes.\n", sizeof(long));
    printf("Type long long has a size of %zd bytes.\n",sizeof(long long));
    printf("Type double has a size of %zd bytes.\n",sizeof(double));
    printf("Type long double has a size of %zd bytes.\n",sizeof(long double));
    return 0;//  w w  w . j  a v  a2 s.  co  m
}

Result


Related Tutorials