Ask your own question, for FREE!
Mathematics 22 Online
OpenStudy (anonymous):

How do I get 64-bit integers in C?

OpenStudy (agreene):

@Computer Science

OpenStudy (anonymous):

long long int

OpenStudy (anonymous):

I tried and it said 'long long long too long for gcc'

OpenStudy (anonymous):

oh just 2 longs :-P

OpenStudy (anonymous):

and a single long is guaranteed 32 bit int right?

OpenStudy (anonymous):

yes

OpenStudy (anonymous):

and if I just type in 'int' it depends on the target machine right?

OpenStudy (anonymous):

what about all the int64_t types defined in <stdint.h>

OpenStudy (anonymous):

int , long and long int would declare 32 bit integer

OpenStudy (anonymous):

/* 7.18.1.1 Exact-width integer types */ typedef signed char int8_t; typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; /* 7.18.1.2 Minimum-width integer types */ typedef signed char int_least8_t; typedef unsigned char uint_least8_t; typedef short int_least16_t; typedef unsigned short uint_least16_t; typedef int int_least32_t; typedef unsigned uint_least32_t; typedef long long int_least64_t; typedef unsigned long long uint_least64_t; /* 7.18.1.3 Fastest minimum-width integer types * Not actually guaranteed to be fastest for all purposes * Here we use the exact-width types for 8 and 16-bit ints. */ typedef signed char int_fast8_t; typedef unsigned char uint_fast8_t; typedef short int_fast16_t; typedef unsigned short uint_fast16_t; typedef int int_fast32_t; typedef unsigned int uint_fast32_t; typedef long long int_fast64_t; typedef unsigned long long uint_fast64_t;

OpenStudy (anonymous):

so that file is bogus it just renames my types?

OpenStudy (anonymous):

ah it's C99 :-P

OpenStudy (anonymous):

dude .. you give me headache :P

OpenStudy (anonymous):

why don't you just relax and learn one thing at a time ? :P

OpenStudy (anonymous):

but I don't learn so well the bottom_up way :(

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!