help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allocating 64 bits


From: Ulrich Eckhardt
Subject: Re: Allocating 64 bits
Date: Thu, 09 Mar 2006 22:28:12 +0100
User-agent: KNode/0.9.3

Paulo Matos wrote:
> I'd like to have access to 64 bits. I think unsigned long long is 64
> bits in g++ although I'm not sure. Is there a way to know which type is
> 64 bits long or not?

#include <stdint.h> and use uint64_t. On systems that lack that header,
<inttypes.h> might provide some replacement. In any case work with a
typedef that shows that you want 64 bits.

> Still, even if I know that unsigned long long is 64 bits long, how can
> I know that it will occupy only two registers in a 32bit PC, or 1
> register in a 64bit PC? Is there a way to make sure a 64 bit value, be
> it an unsigned long long or a unsigned char v[8] to be kept on 2
> registers or 1 in 32 bit or 64 bit PC respectively?

Generally, you can't know that portably in C++. Why do you think you need
to?

Uli

-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]