sizeof(long)

Jason Foat jfoat@seasoar2.ucsd.edu
Tue Jul 2 18:10:00 GMT 2002


Hi Folks,

Here's another problem for the collective wisdom of the group:

The follow-code

#include <stdio.h>

int main(int argc, char **argv)
{

   printf("int: %d \n",sizeof(int));
   printf("long: %d \n",sizeof(long));

}

returns:

int: 4
long: 4

I'm using gcc version 2.96 with linux 7.2 for i686. My questions:

1) Does this seem right? Shouldn't longs have more bytes?

2) Is this a product of some compile option or something? 

3) How can I fix this? (I need an int with more oomph!)

Thanks,

Jason Foat
UCSD  



More information about the Gcc-help mailing list