Search code examples
c++variable-types

C++ `long long` variable type


I am now studying about writing binary files. I've seen this question on StackOverflow. And the author says, in his code

const unsigned long long size = 1ULL*1024ULL*1024ULL;

I don't actually know what are the ULL symbols. Could anybody give me some documentation about it? I have searched on Google, and everything I get is more documentation about writing files...


Solution

  • It is a suffix that specifies the type of literal (in this case, integer literals).

    You can find out more about this in the C++ standard, specifically in 2.14 - Literals

    In your case, the answer lies in the following table (from this very part of the standard) : unsigned long long.

    Integer literals suffixes