Tuesday, March 29, 2011

Simple C++ question: What's the output of this program?

char is a type that holds an 8 bit value. 1 0000 0000 in base 2 has 9 bits. There's no bug; char simply can't hold 256. The maximum is 255.

No comments:

Post a Comment