Actually
array == {'0','0','0','0','0','0','0','0'}
not allowed, you cannot compare arrays like this. Rather do it in a loop:
int row_is_all_zeroes(char arr[8]) { for (int i = 0; i < 8; i++) { if (arr[i] != '0') return 0; } return 1; }
If you want a more elegant solution, look at the answers from iharob or Sourav.
source share