C# is sooo stupid!

alienationware

New Member
QBASIC Task:

DIM dArray(2)
dArray(1) = 0
dArray(2) = 1
GOSUB ModArray:

ModArray:
dArray(1)=(dArray(1)+dArray(2))/2
RETURN

----------------------------- Simple? Yes? --------------------------------

Now watch the same thing under C#:

public class Program
{
public void Main ()
{
double[] dArray = { 0, 1 };
ModArray();
}
public void ModArray()
{
dArray[0] = (dArray[0] + dArray[1])/2
}
}

WTF!!! Why can't I get the same thing to work under C#? Could someone point out where I went wrong in the C# code?
 
Back
Top