int b[5] = {1,2,3,4,5};
int *s = &b[0];
int *p = &b[1];
int *q = &b[2];
int *r = &b[2];
My question is when I compare p < q < r
using if( p < q < r)
, I got the warning message.
What I thought is, first of all, (p < q) == True
, so it's impossible to compare boolean with integer( address value of r). However, when True
is considered as integer, it's 1. Right? So, 1 < r
might make sense, in my guess.
What's wrong with my thought?