64 bit numbers

Started by
7 comments, last by SiCrane 18 years, 7 months ago
Does anyone know how to use 64 bit integers in dev-cpp? Thanks. mike http://www.coolgroups.com/
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
Advertisement
In DevCpp's version of the gcc compiler, long long should be 64 bits.
__int64 ?
__int64 only works on MSVC and Borland's compiler AFAIK.
Quote:Original post by dyerseve
__int64 only works on MSVC and Borland's compiler AFAIK.


...and Dev-cpp. I think dev-cpp can import from MSVC.
Although Dev-cpp itself is only the IDE.
Here's a reasonably portable way of getting integers with fixed sizes, it shouldn't be too hard to add other compilers without stdint.h either.
#ifdef _MSC_VERtypedef __int8 s8;typedef __int16 s16;typedef __int32 s32;typedef __int64 s64;#else#include <stdint.h>typedef int8_t s8;typedef int16_t s16;typedef int32_t s32;typedef int64_t s64;#endiftypedef unsigned s8 u8;typedef unsigned s16 u16;typedef unsigned s32 u32;typedef unsigned s64 u64;
Quote:Original post by doynax
Here's a reasonably portable way of getting integers with fixed sizes, it shouldn't be too hard to add other compilers without stdint.h either.

Here's one better:

#include <boost/cstdint.hpp>


[Edited by - SiCrane on September 1, 2005 7:18:06 AM]
nit picking, but it's cstdint.hpp in 1_32 :)
Oops. Typo.

This topic is closed to new replies.

Advertisement