C# Language Reference

C# is an object orientated language created by Microsoft. Source files are stores as .CS files.

Useful Links

Precedence of Operators Description of the order in which operators are evaluation (for example * is execute before +)

Additional Namespaces

Additional namespaces can be added with the using directive. This will allow classes in other namespaces to be called without additional references. For example:

using System;
Console.WriteLine("Hello World");

Is a short way of saying:

System.Console.WriteLine("Hello World!");

Variable Types

C# variables are made of of both Value Types and Reference Types. Value Types are stored in memory as a data value and Reference Types are stored in memory as a reference or pointer.

Reference Types
TypeNameDeclaration ExamplesDescription
array[]n/aint[] scores;
int[] scores = new int[3];
int[] scores = {1, 4, 6};
A sequence of values
stringStringstring message;
string message = "Hello";
A sequence of characters
objectObjectCar holden = new Car();An instance of a class, derived from the base object Object
dynamicn/adynamic d = 15;Can store any type
pointer*n/aint* addr;
Stores memory address