Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Passing MultiDimensional Arrays to a method in C#
yamid
Nov 11 2009 10:55 AM
3.2k
Reply
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)
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
c# countdown using a timer
Problem in DataGridView using c#