Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is 1UI64 type?

Tags:

c

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

like image 435
mousey Avatar asked Dec 21 '25 14:12

mousey


2 Answers

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

like image 122
RichieHindle Avatar answered Dec 24 '25 03:12

RichieHindle


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:

  • http://msdn.microsoft.com/en-us/library/2k2xf226.aspx

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

like image 30
Michael Burr Avatar answered Dec 24 '25 04:12

Michael Burr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!