Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uint is 32 bits no matter the system is 32 or 64 bits?

Tags:

c#

in C#, uint is a UInt32 type so it will be always 32 bits long no matter the OS is 32 or 64 bits. Am I right?

like image 358
5YrsLaterDBA Avatar asked Apr 05 '11 14:04

5YrsLaterDBA


1 Answers

Yes, that's right. uint is always an alias for global::System.UInt32 (and yes, that's always 32 bits :). The same logic applies for the other predefined aliases.

The only built-in value type I can think of which has a size varying by platform is IntPtr, for obvious reasons. (Any value type which composes an IntPtr would have the same behaviour, of course. SafeHandle springs to mind.)

like image 193
Jon Skeet Avatar answered Sep 29 '22 18:09

Jon Skeet