I would like to check if value B is between A and C ,
my first try is if(A < B < C)
, however the result is not right ,after I try if(A < B && B < C)
and it works well
The second method is intuitive to me , but I do not know why first one fails and what C++ actually does in if(A < B < C)
operation?
Can someone explains to me , Thanks!