Ask your own question, for FREE!
Computer Science 30 Online
OpenStudy (anonymous):

C++ question with unsigned char how can i prove this: unsigned char a = 195, unsigned char b=87, unsigned char c, c=a+b. as such c prints C

OpenStudy (e.mccormick):

What do you mean by prove?

OpenStudy (anonymous):

@e.mccormick, i figured it out.... it was supposed to be c=a&b which when programmed gave C....

OpenStudy (e.mccormick):

Ah, yes, because chars can be used as shorts for certain things. It looks at at the ascii value. In this case the procedure being done would be a bitwise and, so it would look at their binary values. That makes a lot more sense since the additive version you fist put up would have been a different value.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!