Home Page

The .NET Framework uses a non-language specific standard called the Common Type System (CTS) for all variable types.  The CTS standard ensures that every .NET language use a common set of variable types.  Since all .NET languages use a common set of types, they are easily integrated at runtime.  A C# program can easily call a VB.NET component and vice-versa.  So when you talk about C# variable types, you are really talking about .NET variable types.

This is important to understand because although the syntax of the C# language is different than VB.NET and others, the data types used are the same.  Every time you declare a variable type in C# like “int” for example, you are really declaring a .NET Framework type called Int32, which is a large 32 bit signed integer number.

Here are some of the most commonly used C# data types:
int - 32 bit signed integer
long - 64 bit signed integer
float - 32 bit floating point number
double - 64 bit floating point number
bool - true or false
string - series of text characters (almost every C# program has some)

When you declare any of these types in your program, C# transparently implements these data types as official .NET classes in the “System” Namespace as part of the Framework.  You will find that all data types in C# are actually classes, or objects, that contain methods and properties, but more about that later.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment