Basic Overview of C #

What is C#?
C# (pronounced C-sharp) is a one kind of objects oriented language developed by Microsoft Corporation. It is designed with the combination of C and C++. It has taken a lot of concepts from Java.

Data Types in C#
In a programming language Data Types describes what type of data a variable can hold. C# is a strongly typed language. That means every variable and object must have a declared type. When we declare a variable, we have to tell the compiler about what type of the data the variable can hold. In C# programming language, Data types are divided into three categories:

Value Type

Reference Type

Pointer Type

Value Type
A Value Type variable stores a copy of the value in the memory. Some common examples are int, char, float. When we declare an int type, the system allocates memory to store the value.Example of Built-In Value Types : int, char, float, long, double, byte, bool etcExample of User-Defined Value Types : struct, enumerations/enum

Reference Type
A Reference Type stores the address of the value in the memory. It does not contain the actual data stored in a variable. They contain a reference to the variables.Example of Built-In Reference Types : object, dynamic, stringExample of User-Defined Reference Types : class, interface, delegate, Array, HashTable

Pointer Type
Pointer type variables store the memory address of another type. Pointers in C# have the same capabilities as in C or C++.Example: char* cptr, int* iptr

What is Boxing and Unboxing?
In C# it is possible to convert a value of one type to a value of another type. The operation or process of Converting a Value Type to a Reference Type is called Boxing and the operation or process of converting a Reference Type to a Value Type is called Unboxing.

About Author

Rashed

I’m Rashedul Alam, software engineer/architect, technical blogger, and educator. I have over 10 years of working experience in the field of software design and development. I like to share my knowledge and technical stuff with others. I am a community contributor, providing problem solving answer through different forum.