matthiasm wrote:
>
>>> // Assume pairs of bytes: <char> <nul> <char> <nul> .. <nul> <nul>
>>> void multibyte_convert(const char *in, char *out)
>>> {
>>> for ( ; *in; out++, in+=2 )
>>> { *out = *in; }
>>> }
>>
>> to Greg: wouldn't the above code miss the trailing zero byte?
>
>
> No, the line
>
> for ( ; *in; out++, in+=2 )
>
> could also be written as:
>
> while (*in) {
> ...
> out++; in+=2;
> }
... and (*in) is false for the trailing (or any other) zero byte
(in the first position of these byte pairs), and thus the zero
byte wouldn't be copied. Right?
Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk