Assigning Values to an Array: Difference between revisions

(added standard ml)
Line 85:
=={{header|C sharp|C #}}==
'''Language Version:''' 1.0+
<lang csharp>
 
public void WriteToIntArray(int[] array, int loc, int val){ array[loc]=val; }
{
//if the index (zero based) we want to use is greater/equal to our length (one based) throw an exception
if (loc >= array.Length) throw new Exception("Location is out of range.");
//write value to array
array[loc] = val;
}
</lang>
 
=={{header|C++}}==
Anonymous user