18.07.2016, 18:57
sscanf returns 0 when succeed, and 1 when failed,
the code under this statement is called when a failure occurs of sscanf function here.
the code under else { is called when sscanf returns 0 (success)
so, to check if sccanf succeed, which means it returned 0:
that means if the function sscanf returned a zero, and without the NOT operator ("!") it means if the function returned another value higher than zero
Код:
if(sscanf(params, "rd", id, dif)) {
the code under else { is called when sscanf returns 0 (success)
so, to check if sccanf succeed, which means it returned 0:
Код:
if(!sscanf(params, "Rd", id, dif))