C# Value Types Default Values

Published 2/25/2016 by Christian in Code
Tags:

According to: https://msdn.microsoft.com/da-dk/library/83fhsxwc.aspx

the default values of C# Value Types, are as followes:

Value type

Default value

bool

false

byte

0

char

'\0'

decimal

0.0M

double

0.0D

enum

The value produced by the expression (E)0, where E is the enum identifier.

float

0.0F

int

0

long

0L

sbyte

0

short

0

struct

The value produced by setting all value-type fields to their default values and all reference-type fields to null.

uint

0

ulong

0

ushort

0

As always, feel free to comment, or ask.