Re: Introduce a C Compiler ucc
In article <68rrekF2uf7l9U 1@mid.individua l.net>,
Ian Collins <ian-news@hotmail.co mwrote:
>>
>Yes, it does apply. On an output operation, '\n' is replaced by an
>ASCII LF character. (As it happens, '\n' already is an ASCII LF
>character, so the replacement is particularly easy to do.)
>>
>'a' is also replaced by ASCII 'a' character, so what's the difference?
On ASCII systems, 'a' IS an ASCII 'a' character, in all contexts a C
program cares about.
In the context of I/O operations on a file opened in text mode, '\n' is
a C end-of-line character, which is converted to a host-OS end-of-line
on output. The fact that '\n' is an ASCII LF on ASCII systems and that
a Unix end-of-line is an ASCII LF at the end of the line makes the
conversion in this case trivial, but it IS a conversion.
(If that bothers you, consider: I have a char *, and I assign it to a
void *. Did a conversion happen? Did anything change as a result?[1])
In other words: On Unix, text mode is indistinguishab le from binary
mode, but they are still two distinct modes.
dave
[1] Answers: Yes, a conversion happened; and yes, the type of the
pointer changed, but (unless you're on a DS9K.x where they've found
a loophole in the "same representation" requirement), nothing about
the actual bits making up the pointer has changed.
--
Dave Vandervies dj3vande at eskimo dot com
Try holding the 3 bits in place, but shift the rest of your computer's memory
right to left. --Kaz Kylheku gives stupid answers to stupid questions in CLC
In article <68rrekF2uf7l9U 1@mid.individua l.net>,
Ian Collins <ian-news@hotmail.co mwrote:
>Keith Thompson wrote:
>Ian Collins <ian-news@hotmail.co mwrites:
>>Not on a Unix systems, where there isn't a "text mode".
>Yes, it does apply. On an output operation, '\n' is replaced by an
>ASCII LF character. (As it happens, '\n' already is an ASCII LF
>character, so the replacement is particularly easy to do.)
>>
program cares about.
In the context of I/O operations on a file opened in text mode, '\n' is
a C end-of-line character, which is converted to a host-OS end-of-line
on output. The fact that '\n' is an ASCII LF on ASCII systems and that
a Unix end-of-line is an ASCII LF at the end of the line makes the
conversion in this case trivial, but it IS a conversion.
(If that bothers you, consider: I have a char *, and I assign it to a
void *. Did a conversion happen? Did anything change as a result?[1])
In other words: On Unix, text mode is indistinguishab le from binary
mode, but they are still two distinct modes.
dave
[1] Answers: Yes, a conversion happened; and yes, the type of the
pointer changed, but (unless you're on a DS9K.x where they've found
a loophole in the "same representation" requirement), nothing about
the actual bits making up the pointer has changed.
--
Dave Vandervies dj3vande at eskimo dot com
>I am trying to move 3 bits from left to right with >operator
right to left. --Kaz Kylheku gives stupid answers to stupid questions in CLC
Comment