default value of type

  • Thread starter Thread starter Franz
  • Start date Start date
F

Franz

I would like to know if there is a list for default values of types (e.g.
int, float, bool, System.Drawing.Color, String, etc)?
Thanks.
 
Franz wrote:
|| I would like to know if there is a list for default values of types
|| (e.g. int, float, bool, System.Drawing.Color, String, etc)?
|| Thanks.
||
|| --
|| Franz Wong
|| My C++ and C# Site (Traditional Chinese) : http://www.franzwong.com

Check the : "Default Values Table" in the C# reference manual, for the built-in types.
There is no list of default values for FCL types, you should inspect each type independently.
f.i System.Drawing.Color has [Empty] default see Description of System.Drawing.Color.

Willy.
 
Franz wrote:
|| Thank you first.
|| For System.Drawing.Color, I know that Empty is the default value.
|| But I can't find that in the MSDN reference.
||
|| --
|| Franz Wong
|| My C++ and C# Site (Traditional Chinese) : http://www.franzwong.com
||

That's right, but if you take a look at the description of IsEmpty, it certainly contains a hint :-).

Willy.
 
Hi!

Reference types are set to null by the CLR and valuetypes to zero (Except
for bool which is set to false).
 
Back
Top