Quote:
'System.InvalidCastException'
Helps a bit, but knowing which line would make our job easier...
At a guess, it's this line:
m[h,j] =(int)a[i]+(int)a[i+1] ;
and it implies that
a
does not contain integers. So start by looking at what exactly Tab_Mat does return, then use the debugger to find out exactly what is in
a[i]
and
a[i + 1]
when the problem occurs.
We can't do that for you: we don't have any access to your code while it's running!