help-gplusplus
[Top][All Lists]
Advanced

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

Re: Allocating 64 bits


From: Paulo Matos
Subject: Re: Allocating 64 bits
Date: 10 Mar 2006 06:26:35 -0800
User-agent: G2/0.2

Ulrich Eckhardt wrote:
> 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.
>

Thanks for the tip! :)

> > 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?
>

I don't need to... I just would like to know that... curiosity. Still,
I know it is not possibly in portable C++ but that's why I posted here.
Any g++ specific way?

Thanks,

Paulo Matos

> 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]