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 17:51

>>19
#include <stdint.h>
#include <stdio.h>
#include <string.h>

int main(){
 char dashes[sizeof(intmax_t) + 1] = {0};
 memset(dashes, '-', sizeof(intmax_t));
 printf("A char is this big: |%s|\n", dashes + sizeof(intmax_t) - sizeof(char));
 printf("An int is this big: |%s|\n", dashes + sizeof(intmax_t) - sizeof(int));
 printf("A long is this big: |%s|\n", dashes + sizeof(intmax_t) - sizeof(long));
 return 0;
}

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