string array
-
I add this member to mny class:
private string[][] lines;
Then in one function I use this:
for(int i=1 ; i < myDataView.Table.Rows.Count ; i++)
{
for(int j=0 ; j < myDataView.Table.Columns.Count ; j++)
{
lines[i][j]= "mazy";
}
}But for the line 'lines[i][j]= "mazy";' I got unhandled error: Object reference not set to an instance of an object. What I missed for string[][]? Thanks Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
Wish You Were Here-Pink Floyd-1975 -
I add this member to mny class:
private string[][] lines;
Then in one function I use this:
for(int i=1 ; i < myDataView.Table.Rows.Count ; i++)
{
for(int j=0 ; j < myDataView.Table.Columns.Count ; j++)
{
lines[i][j]= "mazy";
}
}But for the line 'lines[i][j]= "mazy";' I got unhandled error: Object reference not set to an instance of an object. What I missed for string[][]? Thanks Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
Wish You Were Here-Pink Floyd-1975You aren't initialising the jagged array. MSDN: Before you can use myJaggedArray, its elements must be initialized From the look of your code, you might find a multidimensioned array more useful. Here's the construct:
private static string[,] lines= new string[10,100];
Cheers, Simon X-5 452 rules. -
You aren't initialising the jagged array. MSDN: Before you can use myJaggedArray, its elements must be initialized From the look of your code, you might find a multidimensioned array more useful. Here's the construct:
private static string[,] lines= new string[10,100];
Cheers, Simon X-5 452 rules.