The C99
standard requires that "A byte with all bits set to 0, called the null character
, shall exist in the basic execution character set; it is used to terminate a character string." (5.2.1.2) It then goes on to list 99 other characters that must be in the execution set. Can a character set be used in which the null character is one of these 99 characters? In particular, is it allowed that '0' == '\0'
?
Edit: Everyone is pointing out that in ASCII, '0'
is 0x30
. This is true, but the standard doesn't mandate the used of ASCII.