2

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...

Victor
  • 13,914
  • 19
  • 78
  • 147

2 Answers2

4

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

JBL
  • 12,588
  • 4
  • 53
  • 84
2

It makes 1 and 1024 be unsigned long long constants or else they'd default to int (in terms of how many bytes the value will take to be represented):

std::cout << sizeof(1ULL) << sizeof(1);

Iosif Murariu
  • 2,019
  • 1
  • 21
  • 27