Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the OSX, C equivalent for uint32 and uint64?

Tags:

c

xcode

macos

I imagine this is a question that has been asked a thousand times but I can't find a straight answer.

I'm trying to port a very short, C function (initially written for Windows) to OSX, using XCode.

I've created an XCode, Terminal application project and I've copied and pasted the code into the project. XCode is giving me a bunch of errors telling me that the type uint32 and uint64 are unknown types.

What are the equivalent value types in OSX?

like image 920
RLH Avatar asked Aug 28 '12 19:08

RLH


People also ask

What is UInt32 in C?

In C#, UInt32 struct is used to represent 32-bit unsigned integers(also termed as uint data type) starting from range 0 to 4,294,967,295.

What is uint64_t in C?

The UInt64 value type represents unsigned integers with values ranging from 0 to 18,446,744,073,709,551,615. Important. The UInt64 type is not CLS-compliant. The CLS-compliant alternative type is Decimal. Int64 can be used instead to replace a UInt64 value that ranges from zero to MaxValue.

How many bits is UInt64?

The range for the UInt64 type is from 0 through 2^64-1 . The size of UInt64 is 64 bits across all 64-bit and 32-bit platforms.


1 Answers

You can use uint32_t and uint64_t by importing stdint.h.

like image 125
Jon Shier Avatar answered Oct 19 '22 12:10

Jon Shier