What is a long long type?

Possible duplicate:
"long int", "long long" Data Types

I am new to C ++ and I looked at the sample code and I saw a long long type. He says something like this

long long deviceId;

Is it the same as long? I am trying to send device id from java (Android) to my server. In java, the device identifier is a long type (8 bytes), and I put it in a buffer, for example

bytebuffer.putLong(Long.valueOf(deviceId));

I am trying to parse this on my Linux server using C ++.

Thanks in advance.

+3
source share
3 answers

long long long ( , , 64- POSIX). , a long long , long. long long 64- .

long long 8- , int64_t/int_least64_t <stdint.h>/<cstdint>, , ≥64 .

#include <stdint.h>
...
int64_t deviceId;
+5

http://gcc.gnu.org/onlinedocs/gcc/Long-Long.html

ISO C99 , 64 , GCC C90 ++. long long int integer unsigned long long int . long long int, LL' to the integer. To make an integer constant of type unsigned long long int, add the suffix ULL ' .

+2

C99 and C ++ 0x differ in meaning long long int. (In C ++ 2003, no long long int, although many vendors supply it.) C99 is very specific: long long int is at least 64 bits. C ++ 0x is incredibly vague: sizeof (long long int)> = sizeof (long int)> = sizeof (int)> = sizeof (short int)> = sizeof (char signed). The only one with a special meaning is int, which is the most natural for the runtime.

0
source

All Articles