Original Post
Ok my book has code to show a number in binary and I am only confused at one part if(u&t) When does that equal true and when does it equal false. When it makes a change it equals true? And if it doesnt it equals false? I thought it just outputs a resulting binary sequence.
void show_binary(unsigned int u)
{
int t;
for(t=128;t>0;t=t/2)
if(u&t) cout << "1 ";
else cout << "0 ";
cout << "\n";
}