K
Kobu
I have a question about C's abstract "streams" (that I can't seem to
FULLY understand from reading several tutorials).
Streams seems to suggest that input can be treated continously if
needed. Is this true?
So far as I know, I can only get a stream to "flow" when there is a
'\r'. At that point the '\r' is turned into a '\n' and the whole
stream is sent to some abstract area that is now only accessible to my
programs (meanwhile, other data is still piling into the input
"staging" area of the stream, waiting for another '\r' to free them-
allow them to flow).
Is this an accurate observation of C's model? Is there anyway I can
get more of a continuous stream action, instead of this '\r' triggered
stream? I am guessing there might be, but it would be a
C-extension!?!?
By the way, the first couple examples using getchar in K&R2 rely on
comparing (c=getchar()) with EOF. But, what happened to the final '\r'
that actually releases the EOF from it's input staging area? Does that
'\r' stay there waiting to release the next char that comes to the
input to the stream? Does that '\r' get converted to '\n' and sent on
it's way ready for immediate reading by an input function? Does that
'\n' disappear because of some relationship with EOF?
A link to comprehensive tutorials will be appreciated.
FULLY understand from reading several tutorials).
Streams seems to suggest that input can be treated continously if
needed. Is this true?
So far as I know, I can only get a stream to "flow" when there is a
'\r'. At that point the '\r' is turned into a '\n' and the whole
stream is sent to some abstract area that is now only accessible to my
programs (meanwhile, other data is still piling into the input
"staging" area of the stream, waiting for another '\r' to free them-
allow them to flow).
Is this an accurate observation of C's model? Is there anyway I can
get more of a continuous stream action, instead of this '\r' triggered
stream? I am guessing there might be, but it would be a
C-extension!?!?
By the way, the first couple examples using getchar in K&R2 rely on
comparing (c=getchar()) with EOF. But, what happened to the final '\r'
that actually releases the EOF from it's input staging area? Does that
'\r' stay there waiting to release the next char that comes to the
input to the stream? Does that '\r' get converted to '\n' and sent on
it's way ready for immediate reading by an input function? Does that
'\n' disappear because of some relationship with EOF?
A link to comprehensive tutorials will be appreciated.