Software Code
    New Code     Most Interesting     Don't Miss     Our picks  
C# - section

View Article
How to declare a variable in C#
See how to declare a variable in C# and also take a look at the default values of some variables
bool b; //Declares variable i as a bool (true/false)
byte bt; //Declares variable bt as byte
char c; //Declares variable bt as char
int i; //Declares variable i as an integer
float f; //Declares variable f as a float
double d; //Declares variable d as a double
decimal z; //Declares variable z as a decimal
string s; //Declares variable s as a string
object o; //Declares variable o as an object

Default values:
Value Type Default Value
bool false
byte 0
char '\0'
int 0
float 0.0F
double 0.0D
decimal 0.0M
string null
object null

Applies to Microsoft Visual C# 2003
Date: 2007-5-15    Written by: Admin A
     See all articles in this section
Copyright © 2007-2009 SoftwareRiviera.com. All rights reserved.  | Terms of use | Disclaimer | Privacy Policy |