- #1
cjm2176
- 8
- 0
Hello all,
I am trying to determine if my machine is 64 bit or 32 bit, according to this site:
http://support.apple.com/kb/ht3696"
the Intel Core 2 Duo I am using is 64 bit, but when I run the following code
I get the output:
char 8, int 32, long 32, long long 64, float 32, double 64, pointers 32
If my machine is 64 bit should I be getting int 64 instead of int 32? If yes could this be a problem? I am using GNU compilers, i.e. gcc.
Thanks
cjm2176
I am trying to determine if my machine is 64 bit or 32 bit, according to this site:
http://support.apple.com/kb/ht3696"
the Intel Core 2 Duo I am using is 64 bit, but when I run the following code
Code:
#include <stdio.h>
int main(int argc, char **argv)
{
char c;
int i;
float f;
double d;
long l;
long long ll;
printf("char %ld, int %ld, long %ld, long long %ld, float %ld, double %ld, pointers %ld\n",
8*sizeof(c),
8*sizeof(i),
8*sizeof(l),
8*sizeof(ll),
8*sizeof(f),
8*sizeof(d),
8*sizeof(&c));
}
I get the output:
char 8, int 32, long 32, long long 64, float 32, double 64, pointers 32
If my machine is 64 bit should I be getting int 64 instead of int 32? If yes could this be a problem? I am using GNU compilers, i.e. gcc.
Thanks
cjm2176
Last edited by a moderator: