Learn more with dummies

Enter your email to join our mailing list for FREE content right to your inbox. Easy!

By Bill Sempf, Charles Sphar, Stephen R. Davis

Part of C# 2010 All-In-One For Dummies Cheat Sheet

It’s not always easy to sort out C#’s variables. The following table offers a comparison of all C# variable types except integer and floating point, which are covered elsewhere.

Type Range In Use
decimal Up to 28 digits decimal d = 123M;
BigInteger NA Too humongous to list.
char 0 to 65,535 (codes in the Unicode character set) char x = ‘c’;
char y = ‘x123’;
char newline = ‘n’;
string From Empty (“”) to a very large number of characters
in the Unicode character set
string s = “my name”;
string empty = “;
bool True and False bool b = true;
Dynamic Determined at runtime Dynamic f = foo()