C# Reference

Summary reference sheets for C#

 Params in C# can be used to vary the values you pass into an array through a method.  This means that even if you declare an array to be a certain length within your program, you can reuse a method that consists of an array that is not preset with an index range.  The method name in this example is caled PaExample.

BinarySearch() - Class method.  Searches a one dimensional array for a value.  It returns the location or negative value if not found.

int i = Array.BinarySearch (arrayName, value);
Console.Write(i);

Clear() - Class method.  Sets elemnts in the array to zero, false or null depending ont the element type starting at x ending at y positions.

Array.Clear(arrayName, 2, 4);

Clone() - Creates a copy of the array.  Returns an object.

An array is a data structure that can be applied to any variable type (such as integers, strings, etc...). Arrays hold multiple values for a variable type, however the values that they hold must be of that type.  There is more than one way to declare an array in C#. 

Declaration Example 1:

type [ ] variableName = new type [n]

Actual example:

Abs() - Returns the absolute value of a specified number.
Example: Abs(-7); will result in 7

Ceiling() - Returns the smallest whole number greater than or equal to the specified number.
Example: Ceiling(23.45); will result in 24

Cos(), Sin() & Tan() - Returns the cosine, sin and tangent of an angle respectively.

Exp() - Returns the constant e to the specified power

Floor() - Returns the largest whole number less than or equal to the specified number.  Opposite of Ceiling.  Would return 23.