Is there a C++ variant for the long primitive data-type?
A C++ long is only 4 bytes, while a Java long is 8 bytes.
So: Is there a non-decimal primitive type with a size of 8 bytes in C++?
Maybe with some tricks?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Microsoft Visual C++ defines an
__int64type that’s equivalent to Java’slong. gcc hasint64_t. There’s even along long inttype defined in the ISO C99 standard, however according to the standard it’s at least 64 bits wide, but could be wider.But apart from the size, there’s also endianness to consider. The Java standard mandates big endian, but with C, endianness is AFAIK always platform-dependant.