I want to convert some integers into a * based on a rule. I can determine which places in the matrix it should convert, but cannot convert it. I give the program the first matrix and it should return the second matrix:
5 4 5 5 8
5 4 6 4 1
3 4 5 4 6
7 8 4 3 6
5 4 5 5 *
5 4 * 4 1
3 4 5 4 6
7 * 4 3 6
my code is this:
for(int i=1; i<r-1; i++) {
for(int a=1; a<c-1; a++){
if(matrix[i-1][a] < matrix[r][a] && matrix[i+1][a] < matrix[r][a] && matrix[i][a-1] < matrix[r][a] &&
matrix[i][a+1] < matrix[r][a]) {
matrix[r][a] = *;
}
}
}
Edit: The matrix is an int type. I can determine which locations in the matrix should be converted, however the convertion itself does not work.
I get this error: Error: Syntax error on token "*", invalid Expression