Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

WARNING: BLOAT

Name: Anonymous 2008-02-05 9:06

SICKENING, SIRS, SICKENING
AN INT TAKES THE SAME AMOUNT OF MEMORY AS A LONG!!

YOU CAN TEST IT YOURSELF !!

WARNING:THIS WILL DISGUST YOU

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

int main()
{
    char c;
    int i;
    long l;

    printf( "A char is this big: %d\n", sizeof(c) );
    printf( "An int is this big: %d\n", sizeof(i) );
    printf( "A long is this big: %d\n", sizeof(l) );
}

Name: Anonymous 2008-02-05 11:33

From the C90 standard:

5.2.4.5.1  Sizes of integral types <limits.h>

The values given below shall be replaced by constant expressions suitable for use in #if preprocessing directives. Moreover, except for CHAR_BIT and MB_LEN_MAX, the following shall be replaced by expressions that have the same type as would an expression that is an object of the corresponding type converted according to the integral promotions. Their implementation-defined values shall be equal or greater in magnitude (absolute value) to those shown, with the same sign.

[...]

-- minimum value for an object of type int
   INT_MIN                              -32767

-- maximum value for an object of type int
   INT_MIN                              +32767

[...]

-- minimum value for an object of type long int
   LONG_MIN                        -2147483647

-- maximum value for an object of type long int
   LONG_MIN                        +2147483647

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List