3

I recently saw this 1UI64 type. I didnt get what kind of type is it. How can they use 1 before ?

mousey
  • 11,601
  • 16
  • 52
  • 59

4 Answers4

8

It's not a type, it's a 64-bit constant integer of value 1.

RichieHindle
  • 272,464
  • 47
  • 358
  • 399
5

In Microsoft C/C++ The I64 part of the expression is a suffix for integer constants that indicates the constant should be a 64-bit type:

This is a Microsoft extension, even though the docs don't call that out.

A somewhat more portable way to specify such a constant might be to include <stdint.h> and use UINT64_C(1) - MSVC has stdint.h as of VS2010.

For versions prior to that you might consider the options provided in this SO question: C99 stdint.h header and MS Visual Studio

Community
  • 1
  • 1
Michael Burr
  • 333,147
  • 50
  • 533
  • 760
  • 1
    you could also mention the C99 version `UINT64_C(1)` from `stdint.h` – Christoph Nov 23 '10 at 10:46
  • @Christoph: Done. I had a mention about `UINT64_C()` in my answer at first, but decided to leave it out since MSVC complicates the `stdint.h` situation a little. But since you suggested it, I added it back with a bit of detail. – Michael Burr Nov 24 '10 at 03:11
4

That's an unsigned 64-bit 1.

thelost
  • 6,638
  • 4
  • 28
  • 44
2

Probably nonstandard Unsigned Integer 64-bit, or a fixed point 0.64 format.

ysap
  • 7,723
  • 7
  • 59
  • 122