View Single Post
Old 10-15-2004, 06:17 PM   #3 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
Quote:
A byte is AT LEAST 8 bits.
c++ does not define a byte at all.
a char must be of size 1. however many bits are in "1" is undefined, but a char must be able to store the "basic character set". this can be accomplished in 7 bits.

c99: 6.2.5

2. An object declared as type char is large enough to store any member of the basic execution character set. If a member of the required source character set enumerated in 5.2.1 is stored in a char object, its value is guaranteed to be positive. If any other character is stored in a char object, the resulting value is implementation-defined but shall be within the range of values that can be represented in that type.

as to the original question, see the bit-shift operators (<<, >>)
joe_bruin is offline   Reply With Quote