cout confusion: it treats bool as integer or integer as bool?

  c++, cout

why this

int a = 8; 
cout << a && true ;
cout << typeid(a && true).name();

outputs "8bool"
frankly, I expected "truebool" or 8int
Does operator << of cout object involved in this or any precedence issue?
Does it convert true to 1 as in the case when we cout << true; ?
typeid(a && true) gives us bool, though the cout << a && true ; is obviously a number?

thanks!

Source: Windows Questions C++

LEAVE A COMMENT