Hi i want a help infact clarification of a doubt. I want to know how to read values into a jagged array through keyboard just like we enter values in arrays. Everywher its mentioning only initialization ,i.e feeding the values through code itself. I want to get values from user. How would the coding be? Please help me.
class Program
{
static void Main(string[] args)
{
string[][] stringarr1 = new string[15][];
for (int i=0;i<stringarr1.Length;i++)
{
stringarr1[i]=Console.ReadLine(); }
for(int j=0;j<stringarr1.Length;j++)
{
Console.WriteLine(stringarr1[j]);
}
}
}
This is the code i wrote to read and display strings. But it shows error in the bold statement.
Hoping to receive immediate reply.
Thank you!!!
@Sina