relatively new to C#.
I've written a function that is supposed to fill an array.
public static void fill_array(Array tierkreiszeichen, int startdate, int zeichen_laenge)
{
for (int i = 0; i < zeichen_laenge; i++)
{
tierkreiszeichen[i] = new int[zeichen_laenge];
tierkreiszeichen[i] = startdate + i;
}
I want the function to take the array name as an argument, so if I call it by
fill_array(march, 30);
I want it to fill the values of the array "march" (I created the arrays preemptively)
So it's a rather simple problem. What I can't get to work is passing the name of the array as an argument. The compiler error I'm getting is
"Cannot apply indexing with [] to an expression of System.Array.
Any help shall be welcome & thank you in Advance.
Array tierkreiszeichen, useint[] tierkreiszeichenfill_array(march, 30);what contents should the arraymarchacquire? Please give an example.