Given the definition char matrixarray[6][7]
, calling strcmp(matrixarray[j+k][i], "X")
passes a character to strcmp()
, but it needs a pointer.
Using strcmp(&matrixarray[j+k][i], "X")
is the simplest change. It will fix the compilation problem; it may or may not be correct algorithmically.
Indeed, it probably isn't correct. The comparison cannot succeed unless it is looking at the last character before the null byte in matrixarray[j+k]
. It seems more likely that you should be comparing characters, not strings, so:
matrixarray[j+k][i] == 'X'
it probably more nearly correct.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…