I have several arrays in my Program with diffrent diemensions. for example A, B,C,D,E,...( 5-Dim,4-Dim, ...).
I want to write ONE general method that is able to accept all of those
arrays with different Ranks inwhich the USER just specifies the rank
and program should read this rank and accept it as an argument.
Here I *donot* want to write several methods of the same structure inwhich just the dimensions of input array is changing. instead I will tell the method the dimension of the input array.
for example;
// definition of Array "A","B",..."N" as multi-D arrays of diffrent ranks
....
// Method Victory that Accept an Array of any type but the user should define what is the Rank of the array to be passed
// User Defines this ValueOfRank
int ValueOfRankA =3
....= Victory(A);
int ValueOfRankB =6
....=Victory(B);
...
int ValueOfRankN =3
...=Victory(N)
Passing MultiDimensional Arrays to a method in C#
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sam HobbsRank #107 · 20.5K reputationPosted Nov 11, 2009, 6:43 AM EST
yamid113 reputationPosted Nov 11, 2009, 8:43 AM EST