Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# unsigned int default value

Tags:

c#

What is the default value of unsigned int in c#?

For ex: int, its 0, i want to know for unsigned int, will unsigned int support assigning null value to it?

like image 312
Sharpeye500 Avatar asked Feb 10 '11 17:02

Sharpeye500


1 Answers

Use this to figure it out:

default(uint); //0

To assign a null value to it you need to use a Nullable<uint> or just uint?. Now if you have a uint? you can do the same thing to see it supports a null value.

default(uint?); //null
like image 103
Yuriy Faktorovich Avatar answered Oct 21 '22 22:10

Yuriy Faktorovich