Get the type size - C Data Type

C examples for Data Type:sizeof

Description

Get the type size

Demo Code

#include <stdio.h>
#include <stdlib.h>

int main( void )
{
    printf("int %d", sizeof(int));
    printf("short %d", sizeof(short));
    printf("long %d", sizeof(long));
    printf("long long %d", sizeof(long long));
    printf("float %d", sizeof(float));
    printf("double %d", sizeof(double));

    return 0;//from ww w.j  ava 2s  .co m
}

Result


Related Tutorials