Re: Moving from C++ to VC++

Tech-Archive recommends: Speed Up your PC by fixing your registry



Doug Harrison [MVP] <dsh@xxxxxxxx> wrote:
> On Tue, 14 Jun 2005 12:06:19 +0200, Hendrik Schober wrote:
> > So which type would you suggest using for
> > "longest integer"?
> > (May I suggest 'long int'? <g> )
>
> So on IA8192, all programs that use long would use 8,192 bit integers?

Why not? If it is the longest integer.

> In
> C99 and I expect the next revision to C++, there's even the execrable "long
> long".

Oh well, then 'long long' should be the
longest integer and 'long' should just be
a long one.

> I think a better approach is <inttypes.h>.

IIRC, this defines the 'int_XX' familiy?

> The short/int/long
> division has been inadequate for a long time. [...]

Why?

> With all the talk in this thread of moving forward, how about tightening up
> rules that made more sense in the day when Ritchie was inventing his
> portable assembly language, when hardware was a lot weirder and less
> capable?

Why? If want the fastest and native (for
some definition of "native" anyway) integer,
I use 'int'. If it doesn't have to be as big
and space is a mild concern, I use 'short'.
If it has to be as long as possible, I use
'long'. For many things, this is good enough.

> At least we can work within the existing rules to move forward
> while taking into consideration the code written for the last couple of
> decades of 32 bit machines.


32bit machines are in wide availability since
when? Certainly not for what I'd call "decades".
More important, I'd rather take into consideration
the lessons learned from going from to 32 and
from 32bit, instead of the 32bit itself. 32bits
will be gone soon, such transition will come
again.

Schobi

--
SpamTrap@xxxxxx is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett


.



Relevant Pages

  • Re: Moving from C++ to VC++
    ... >> If I want "the longest integer available on ... >> the platform, how does 'int64_t' help? ... I'm Schobi at suespammers dot org ... Prev by Date: ...
    (microsoft.public.vc.language)
  • Re: Moving from C++ to VC++
    ... > Sure, if you're using __int64 to mean the longest integer available, you'll ... I'm Schobi at suespammers dot org ... Prev by Date: ...
    (microsoft.public.vc.language)