On Thu, 02 Sep 2004 05:23:38 +0200
Philipp Thomas
Colin Carter
[26 Aug 2004 10:06:23 GMT]: Does anybody know if SuSE 64 bit system is really 64 bit code?
Of cause it is.
1: If I define int i; and real x;
What, please, is an int? C/C++ do not know the type real.
do I get 64 bit integer and float if compiled under 64? ints on 64 bits systems are generally 32 bits. Longs are 64 bit on a 64 bit system, and pointers are 64 bits. Just use this small programm to tell you. #include
int main() { printf("Sizeof(int) = %ld\n", sizeof(int)); printf("Sizeof(long) = %ld\n", sizeof(long)); printf("Sizeof(float) = %ld\n", sizeof(float)); printf("Sizeof(double) = %ld\n", sizeof(double)); printf("Sizeof(char *) = %ld\n", sizeof(char *)); return 0; }
Note that I do not have a 64 bit SuSE system at the moment, but I had an
older Linux on Alpha.
Note that there is no primitive type "real" in C or C++. In general
doubles are 64 bits on both 32 and 64 bit systems.
Note that the sizeof operator returns a size_t that is implementation
defined, and may be a long, hence you should use %ld because size_t is
often a long.
--
Jerry Feldman