How to

get default value for type

Published: 21. December 2008 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » Types
Tags: Basics C#
Was this snippet helpful for you? YESYES / NONO
// value type
int value = default(int); // 0

// reference type
string value = default(String); // null
Send us feedback about this snippet »



Related Snippets: