Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Returning an Array InC#

$
0
0
Hi good people once again,

I just stared C#, now i have a problem
with returning an array in a function
here is my Code:
public string[][] PopulationAndFittness(string ChildP,int Row,int column)
          {
              string [,]P= new string[100000,2];

              P[ Row,column] = ChildP;
              int fit = fitness(ChildP);
              P[Row, column] = Convert.ToString(fit);

              return [u]P;[/u]

          }

it says "Error 1 Cannot implicitly convert type 'string[*,*]' to 'string[][]"
look forward to your suggestions

Viewing all articles
Browse latest Browse all 51036

Trending Articles