Datatypes and Variables

Total Post:113

C#  Students 
 387  View(s)
Rate this:

How to initialized a Data types and Variables in C#.

  1. Post:140

    Re: Datatypes and Variables

    Variables and Data types in c# :

    variables like a buckets which stored data value of the type declaration. some steps for follow to declare them is shown below: 

    Step 1: Declaring variables and Assigning values :

    they stored information in string type var. syntax: 

       String FirstName = FirstNameTextBox.Text;

    bucket with the name that unique identifies if:

    string FirstName; 
    FirstName = "Mindstick";

    we declared first name and referenced the erroneously redeclared it. 

    string name ="Mindstick"

    1-string FirstName;
    3-string FirstName="software";


      lets we have two buckets Firstname(string type) and name(mindstick) and put the name value into another.

    FirstName = name;

    var dumping its value into another buckets .boths are hold literal string "mindstick".

    step3- Understanding var naming limitations: 

    -Be atleast one alphabetic char 

    -not start with a numberacly

    -not use of dash- and underscore_

    -not contain any space between words.

    step4- Adding comments in code 

    all primitivec# data types :   bytes , sbytes, short, ushort, int,long,float,double,dec,char,string,bool,objects etc. 

    Happy coding :)