(unsigned) char == (platform) byte ?
  Home FAQ Contact Sign in
comp.lang.c++.moderated only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.c++.moderated Profile…
 Up
(unsigned) char == (platform) byte ?         


Author: dizzy
Date: Jan 4, 2008 10:41

Hi

I know that sizeof(char) == 1 (as per ISO C and C++), (if I remember well
from the C++ standard text) that the definition of a byte was the smallest
object that the machine could address, that a machine byte does hold a char
but we don't know yet that all possible values of a machine byte can be
stored in a char (or unsigned char for that matter).

3.9.1 1 doesn't seem to make it any more clear for "unsigned char".
For "char" it says there is no padding (object representation == value
representation) so I would say this means that indeed "char" is a byte for
the current platform (all byte values are char values and all char values
are byte values). However then for "unsigned char" it says that all bit
combinations of the value representation are valid numbers for it but this
does not tell me if it has padding or not.
Show full article (1.81Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
Re: czy unsigned to to samo co unsigned intpl.comp.lang.c ·
Re: sh reads byte by bytemuc.lists.netbsd.tech.userlevel ·
Re: unsigned char a base de dato o a hexadecimalmicrosoft.public.es.vc ·