By 22/07/2015 7 Comments

C# Character

  • Used to store an unsigned single character.
  • In c# Char supports both ASCII and UNICODE characters.
  • We can store any character in char data type such as (ā€˜Lā€™,’$’,’4′) etc.
  • Char uses single quotations for store a character.
DATA TYPE WIDTH IN BITS RANGE
char 16 0 TO 127

Example:

using System;
namespace csharpBasic
{
    // Start class definition / declaration.
    class Program
    {
        // Static main method void type declaration.
        static void Main(string[] args)
        {
            // Different character types are initialized.
            char charNumber = '1';
            Console.WriteLine("Number as a character: {0}", charNumber);

            char symbol = '$';
            Console.WriteLine("Dollar: {0}", symbol);

            char charAlpha = 'T';
            Console.WriteLine("Alphabetic as a character: {0}", charAlpha);
            Console.ReadKey();

        } // End of main method definition. 
    } // End of class. 
}





Next Tutorial →


← Previous Tutorial


Posted in: C# Basics, C#.NET

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .