vendredi 3 décembre 2021

how do i return variables in c# if [closed]

I have code like this and i want to use numbersB var in other if, how can i return it?

if ((n2 > 0 && n2 <= 10) && (m2 > 0 && m2 <= 10))
{
    for (int i = 0; i < (n2 * m2); i++)
    {
        var lineB = Console.ReadLine().Split(' ');
        var numbersB = Array.ConvertAll<string, int>(lineB, int.Parse);
        return numbersB;
    }
}

Aucun commentaire:

Enregistrer un commentaire