Why is the if statement failed? C++

thank you for identifying this, and how to investigate?