John Gorman wrote:
> Hi,
>
> Here is my program. I run this on every box I ever work on: Dos, MVS, OS2, RS/6000,
>Dec Alpha, and Linux.
>
> And it works on everybox,
>
> Here is my output from my Linux box (an intel 486, running RedHat 5.1)
>
> Size of int = 4
> Size of short = 2
> Size of long = 4
> Size of unsigned int = 4
> Size of unsigned short = 2
> Size of unsigned long = 4
> Size of float = 4
> Size of double = 8
> Size of char = 1
>
> Here is the program:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
>
> int main()
> {
> printf("\nSize of int = %d", sizeof(int));
> printf("\nSize of short = %d", sizeof(short int));
> printf("\nSize of long = %d", sizeof(long int));
> printf("\nSize of unsigned int = %d", sizeof(unsigned int));
> printf("\nSize of unsigned short = %d", sizeof(unsigned short));
> printf("\nSize of unsigned long = %d", sizeof(unsigned long));
> printf("\nSize of float = %d", sizeof(float));
> printf("\nSize of double = %d", sizeof(double));
> printf("\nSize of char = %d", sizeof(char));
> printf("\n\n");
>
> return(0);
> }
>
Yep!! Works fine here too. I get the exact same results under RH 5.0 , gcc /glibc
etc...
/John