Content deleted Content added
m -/Talk |
m '\0' != '0' |
||
Line 5:
=== Representations ===
A common representation is an [[array]] of characters. The length can be stored implicitly by using a special terminating character (often [[NUL]]) (the
Here is a NUL terminated string stored in a 10 [[Integral data types|byte]] buffer.
NUL is the name for the character in [[ASCII]] which has the numeric value of zero. In the C language, NUL is called '\0'.
<PRE>
x x x x x x x x x x
F R A N K
x x x x x x x x x x
</PRE>
The above example is how "FRANK" would look in a 10 byte NUL terminated string. Characters after the \0 do not form part of the representation.
Of course, other representations are possible. Using [[tree]]s and [[list]]s make it easier to insert characters in the middle of the string.
|