undefined behaviour of bool

Правка en1, от electro177, 2021-06-24 09:47:05

while this is working fine ~~~~~ Your code here... bool emp (int i, int j) { if ( i >= 0 && i < n && j >= 0 && j < m && s[i][j] == '.' )return 1; else return 0;

} ~~~~~

this is giving run time error ~~~~~ Your code here...

bool emp (int i, int j) { if ( s[i][j] == '.' && i >= 0 && i < n && j >= 0 && j < m )return 1; else return 0;

} ~~~~~

does anyone know the reason

Теги boolean, run time error, #help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский electro177 2021-06-24 09:47:05 435 Initial revision (published)