Mailinglist Archive: opensuse-programming (148 mails)

< Previous Next >
Re: [suse-programming-e] Is SuSE 64 bit ?
  • From: Jerry Feldman <gaf@xxxxxxx>
  • Date: Thu, 2 Sep 2004 08:40:40 -0400
  • Message-id: <20040902084040.670f0484@xxxxxxxxxxx>
On Thu, 02 Sep 2004 05:23:38 +0200
Philipp Thomas <philipp.thomas@xxxxxxxxx> wrote:

> Colin Carter <colincarter@xxxxxxxxxxxxx> [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 <stdio.h>
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 <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
< Previous Next >
References