Again a short serie of today’s post. Random random = new Random(); random.Next(lowerbounds, upperbounds); if someExpression already false, this will never execute if some expression is already false, this will run AT LEAST ONCE
Monthly Archives: July 2018
C# – Looping with the For Iteration Statement
If you ever in Visual Studio, write down ‘for’ and tip two times ‘tab’ on keyboard, you will be seeing that for Iteration statement would be created for you. i – any variable name 1st part – counter declaration, can be initialized to any number 2nd part – condition, can be any expression that equatesContinueContinue reading “C# – Looping with the For Iteration Statement”
C# – Changing the Length of an Array
We continue with array. This time how we change the length of an array. Arrays are immutable = cannot be changed in memory. However .Net Framework providers helper methods to resize an array… creates a new array and copies the old values into it. //Get the highest index: // 0 = dimension we want toContinueContinue reading “C# – Changing the Length of an Array”
C# – Multi Dimensional Arrays
It is same as single dimensional arrays. just requires more indexes (in dimensions) to get to the element. Here is again some more info from microsoft.com Arrays can have more than one dimension. For example, the following declaration creates a two-dimensional array of four rows and two columns. C# int[,] array = new int[4,ContinueContinue reading “C# – Multi Dimensional Arrays”
C# – Single Dimensional Array
Today we will explore in brief single dimensional array; Index vs. Elements Accessor vs. Stored Values Indexes are zero based Declaring Arrays Declaring and Initializing Arrays Setting / Getting Values As usual, a bit detailed explanation from microsoft.com You can declare a single-dimensional array of five integers as shown in the following example: C# int[]ContinueContinue reading “C# – Single Dimensional Array”