Clarifying C# Variables
Posted by Gizmosis350k
Last Updated: March 22, 2012
  227

In standard C# programming, are int and uint the main variables types you will use for everyday computing?

Is the boolean operator really that useful?

And is the unicode method of typing escape sequences:- 
(eg. Console.WriteIn ("Shana/u0027s diary")) really more flexible than the regular english method?

What importance does the binary table serve for simple values?
   
  
 
 
   

 
 
Variables represent storage locations. Every variable has a type that determines what values can be stored in the variable. C# is a type-safe language, and the C# compiler guarantees that values stored in variables are always of the appropriate type.

variables include:
integer variable
floating point variables
decimal variable
Boolean variable
character variable
string variable

the boolean variable is very important.. it can help determine weather a value is true or false example..

public class MyClass
{
    static void Main()
    {
        bool i = true;
        char c = '0';
        Console.WriteLine(i);
        i = false;
        Console.WriteLine(i);

        bool Alphabetic = (c > 64 && c < 123);
        Console.WriteLine(Alphabetic);
    } 
}   

C# defines the following character escape sequences:

 

\' - single quote, needed for character literals

\" - double quote, needed for string literals

\\ - backslash

\0 - Unicode character 0

\a - Alert (character 7)

\b - Backspace (character 8)

\f - Form feed (character 12)

\n - New line (character 10)

\r - Carriage return (character 13)

\t - Horizontal tab (character 9)

\v - Vertical quote (character 11)

\uxxxx - Unicode escape sequence for character with hex value xxxx

\xn[n][n][n] - Unicode escape sequence for character with hex value nnnn (variable length version of \uxxxx)

\Uxxxxxxxx - Unicode escape sequence for character with hex value xxxxxxxx (for generating surrogates)


 
awesome gonna practice these like crazy when im done sleeping LOL