Hi all,
If I want to say history list was null matrix [][] be 0, How could be written?
the code blew gives an error.
List
- > history = new List
- >() ;
int [][] matrix= new int[5][];
if (history[y].Contains("192.168.2.160", StringComparer.OrdinalIgnoreCase))
matrix[x+4][y] = 1;
else if (history[y].Contains==null)
matrix[x][y] = 0;
thanks
VulpesPosted Aug 26, 2013, 6:32 AM
This line on its own is not sufficient - it just tells the compiler than there are 5 single dimensional arrays within the jagged array.
diamond diamondPosted Aug 26, 2013, 6:53 AM
I correct it with this style
int [,] matrix=new int [5,1000]
diamond diamondPosted Aug 26, 2013, 6:39 AM
I want to create matrix which has 5 rows and history.count columns.
for that as far as I know, it is sufficient to write, is it wrong?
Can you let me know how do I do for that?
diamond diamondPosted Aug 26, 2013, 12:56 AM
int [][] matrix= new int[5][];
The exception message is as same as already message
VulpesPosted Aug 25, 2013, 4:56 PM
Have you initialized matrix[x] somewhere?
matrix[x] = new int[5]; // or whatever
diamond diamondPosted Aug 25, 2013, 4:28 PM
But this time for matrix[x][y] = 0; gives an exception ??!!!
VulpesPosted Aug 25, 2013, 2:45 PM
else if (history[y] == null || history[y].Count == 0)
Note that it's not possible for a List
diamond diamondPosted Aug 25, 2013, 2:08 PM
I used history[].count<=0
this time is run but the command of if gives an exception:
check to determined if the object is null before calling the method
VulpesPosted Aug 25, 2013, 1:53 PM
However, if you want to test that the List