Re: Is __int64 dead?
- From: "Norman Diamond" <ndiamond@xxxxxxxxxxxxxxxx>
- Date: Mon, 27 Aug 2007 09:46:09 +0900
One question has an answer:
Come to think of it - does C++ define *any* types which are guaranteed to be a fixed number of bytes on ALL platforms?
Yes. Types char, signed char, and unsigned char are all guaranteed to be 1 byte long on all platforms.
(This is why we have to remember that "char" != "character".)
"David Webber" <dave@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:OxMs1Wv5HHA.5844@xxxxxxxxxxxxxxxxxxxxxxx
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message news:Oo9lAnq5HHA.1208@xxxxxxxxxxxxxxxxxxxxxxx
I would expect Microsoft to continue to support __int64 whether it's considered part of the ANSI standard or not.
For my personal tastes, I see long long int, and think something along the lines of "now, what size is int on this platform? And so what size is the long? And what does that make long int, and long long int?" If I need a 64-bit data types regardless of the platform I'm compiling to, I use __int64.
I use __int64 a lot too. I have a need for something to hold a set of 64 bit flags in a number of places.
unsigned __int64 does the job.
I also occasionally use unsigned __int32 __int16 and __int8 where the number of bits is important to me. If they weren't there, I'd use DWORD WORD and BYTE (as I do in other contexts), but IIRC those are Microsoft specific too.
Come to think of it - does C++ define *any* types which are guaranteed to be a fixed number of bytes on ALL platforms?
Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm
.
- Follow-Ups:
- Re: Is __int64 dead?
- From: Doug Harrison [MVP]
- Re: Is __int64 dead?
- References:
- Is __int64 dead?
- From: xmllmx
- Re: Is __int64 dead?
- From: Jonathan Wood
- Re: Is __int64 dead?
- From: David Webber
- Is __int64 dead?
- Prev by Date: Re: A weird problem on union alignment, need help!
- Next by Date: Re: Is __int64 dead?
- Previous by thread: Re: Is __int64 dead?
- Next by thread: Re: Is __int64 dead?
- Index(es):
Relevant Pages
|