You can not declare two variables in the for
loop as you are doing it.
You can check this thread for ways to achieve it.
On the snippet you share, certain variables are not declared, numRows
, numCols
, myNums1
.
indexCols2
is not initialized, even though the for loop is not correct as it is.
As @cigien mentioned in the comment, to use an array you will have to allocate memory dynamically if you want to read the size from the user.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…