Matrix1 and Matrix2 are two dimensional arrays. You initialize the rows in both of them but forgot to initialize the columns in Matrix2.
1 2 3 4 5 6 7 8 9
for(int i=0;i<Rows;i++) //You added this first one
{
Matrix1[i]= newint[Cols];
}
for(int i=0;i<Rows;i++) //But you forgot this one
{
Matrix2[i]= newint[Cols];
}
It helps when brackets are always used with loops even when there is only one statement being executed. Helps things be more readable.