How to

check that struct is empty

Published: 26. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » Basics
Tags: Basics C#
Was this snippet helpful for you? YESYES / NONO
int a = 50;
int b = 0;
int c = new Int32();

Console.WriteLine(a == default(int));
Console.WriteLine(b == default(int));
Console.WriteLine(c == default(int));
Console Output:
False
True
True
Send us feedback about this snippet »



Related Snippets: