OOP344
Tuesday, 13 March 2012
problem from prnBits
void prnBits(unsigned int val){
for(int i = sizeof(unsigned int)*8-1; i>=0;printf("%d", !!(val & (1<<i--))));
}
I’m confused about the "sizeof (unsigned int) * 8 -1".........Why should multiplied by 8....
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment