I have a few questions regarding arrays in C#.
- In a Method we can have one return value. Can we return an array?
- If returning an array is not possible, how we can use the array collected in that method and use in a calling method?
Below is my code.
public ArtWorkData[,] getExcelFile(int sheetNumber)
{
string[,] excRecord = new string[rowCount, colCount];
excRecord[0, 0] = { {"TOPRIGHT", "TOPLEFT"},
{"MIDRIGHT", "MIDLEFT},
{"BOTRIGHT", "BOTLEFT"} }
return excRecord;
}
I want to know the logic of it and how we can pass the array out of the method. Thank you guys.