Monday, May 18, 2020

The Structure of C# language.

Hi all,

This is the very first blog post in 'C# Mate'.

As you all know, everything should start from the beginning as it will help all software developers to understand the concepts and the technology used behind the software development language.

According to my own experience, I felt that many developers have sharp knowledge in the specific programming language, which they do not have any idea related to basic concepts and the structure.
So I thought to start my blog with the basics and concepts using in C# language.

C# has an unified type system, allowing both value and referring types.

Types:

Basically, we can find three Types which we can explain as follows,

  1.  Value Type : Variable that are stores data.
  2.  Reference Type : Store references to the actual data.
  3.  Pointer Types : Use in unsafe modes. 
Now, we will go more deep in Types.

- Value Type -

These Types are contains three main components.
  • Simple Types - 
    • Sbyte, Short, Int, Long, Bytes, Ushort, Uint, Ulong, Bool, Char, Float.
  • Structures - 
    • Numeric types (numeric in above Simple Types) , bool, user define structures.
    • Reference : https://msdn.microsoft.com/en-us/library/ah19swz4.aspx.
  • Enums - 
    • Key word to declare enumeration. Contains s set of named values.
    • Reference : https://msdn.microsoft.com/en-us/library/sbbt4032.aspx.
- Reference Type - 

The following are the key words for declare reference type.
  • Class.
  • Interface.
  • Delegate.
In C#, there are also some in-build reference types as well.

  • Dynamic.
  • Object.
  • String.
- Pointer Type -

If the context is unsafe then its better to use pointers. 

Ex : 
  type* identifier;
 void* identifier; //allowed but not recommended


C# Mate :
Dinuka Kodituwakku.








No comments:

Post a Comment