0
Why I have syntax error?!
using System; namespace SoloLearn { public class Program { public static void Main() { int licznik = 1; int[][] tab = new int[4][]; tab[0] = new int[4]; tab[1] = new int[2]; tab[2] = new int[1]; tab[3] = new int[3]; for(int i = 0; i < tab.Lenght; i++;) { for(int j = 0; j < tab[i].Lenght; j++;) { tab[i][j] = licznik++; Console.WriteLine("tab[{0}][{1}] = {2}"i,j,tab[i][j]); } } } } }
4 Antworten
+ 1
Thanks! It worket.
0
I have semi-colons after all increments.
0
I don't have syntax error any more. I have')' and'}' expected.
0
using System;
namespace SoloLearn
{
public class Program
{
public static void Main()
{
int licznik = 1;
int[][] tab = new int[4][];
tab[0] = new int[4];
tab[1] = new int[2];
tab[2] = new int[1];
tab[3] = new int[3];
for(int i = 0; i < tab.Length; i++;)
{
for(int j = 0; j < tab[i].Length; j++;)
{
tab[i][j] = licznik++;
Console.WriteLine("tab[{0}][{1}] = {2}",i,j,tab[i][j]);
}
}
}
}
}