C
chendonghao
Guest
Hi! I'm new with c# and i have a question. I want to create new jagged array when I scroll it, But it says "Cannot assign to 'Write' because it is a 'method group'"
namespace ArrayandString{
class initiali {
static void Main() {
int[][] jagged = new int[3][];
jagged[0] = new int[4];
jagged[1] = new int[5];
int i;
// store values in first array
for (i = 0; i < 4; i++)
jagged[0] = i;
// store values in second array
for (i = 0; i < 5; i++)
jagged[1] = i;
// display values in first array
for (i = 0; i < 4; i++)
Console.Write = (jagged[0] + " ");
Console.WriteLine = (" ");
//display values in second array
for (i=0; i<5; i++)
Console.Write = (jagged[1] + " ");
Console.WriteLine = (" ");
}
}
}
I am truly grateful for all your help
Sorry , my poor English
Continue reading...
namespace ArrayandString{
class initiali {
static void Main() {
int[][] jagged = new int[3][];
jagged[0] = new int[4];
jagged[1] = new int[5];
int i;
// store values in first array
for (i = 0; i < 4; i++)
jagged[0] = i;
// store values in second array
for (i = 0; i < 5; i++)
jagged[1] = i;
// display values in first array
for (i = 0; i < 4; i++)
Console.Write = (jagged[0] + " ");
Console.WriteLine = (" ");
//display values in second array
for (i=0; i<5; i++)
Console.Write = (jagged[1] + " ");
Console.WriteLine = (" ");
}
}
}
I am truly grateful for all your help
Sorry , my poor English
Continue reading...