M
Martin Roos
hy ppl, i'm trying to create some multiplatformed software here and i'm very curious about the sizes of common variables on different machines.
if you are running something different than a 32-bit x86 box under your desk, please check what this program outputs.
//-- program starts --
#include <stdio.h>
#define showsize(x,y) printf("Size of %s %d \n",x,sizeof(y));
typedef struct db_s{
int offset;
int length;
char* data;
} db;
int main() {
showsize("char",char);
showsize("int",int);
showsize("long",long);
showsize("char*",char*);
showsize("int*",int*);
showsize("long*",long*);
showsize("void*",void*);
showsize("db",db);
showsize("db*",db*);
return 0;
}
//-- program ends --
on an 32bit x86 it reports like this :
Size of char 1
Size of int 4
Size of long 4
Size of char* 4
Size of int* 4
Size of long* 4
Size of void* 4
Size of db 12
Size of db* 4
......
are there any 64bit sun users out there ? 64bit x86 machine owners and mac users ?
if you can please report in
if you are running something different than a 32-bit x86 box under your desk, please check what this program outputs.
//-- program starts --
#include <stdio.h>
#define showsize(x,y) printf("Size of %s %d \n",x,sizeof(y));
typedef struct db_s{
int offset;
int length;
char* data;
} db;
int main() {
showsize("char",char);
showsize("int",int);
showsize("long",long);
showsize("char*",char*);
showsize("int*",int*);
showsize("long*",long*);
showsize("void*",void*);
showsize("db",db);
showsize("db*",db*);
return 0;
}
//-- program ends --
on an 32bit x86 it reports like this :
Size of char 1
Size of int 4
Size of long 4
Size of char* 4
Size of int* 4
Size of long* 4
Size of void* 4
Size of db 12
Size of db* 4
......
are there any 64bit sun users out there ? 64bit x86 machine owners and mac users ?
if you can please report in