Kiran Jonnalagadda forced the electrons to say:
> | The best way to solve my problem is to read each element one at a time.
> 
> Reading one at a time from disk is _slow_. I suggest that you read
> everything into a memory buffer and then copy over the data an element at a
> time.

Not necessarily. The stdio library is buffered for non stderr streams, so it
might not make a difference. The size of the buffer is BUFSIZ, which is 8192
bytes on my RHL 6.0 system. So, even the first getchar() on such a stream will
fill the internal buffer.

Binand

-- 
#include <stdio.h>                                   | Binand Raj S.
char *p = "#include <stdio.h>%cchar *p = %c%s%c;     | This is a self-
int main(){printf(p,10,34,p,34,10);return 0;}%c";    | printing program.
int main(){printf(p,10,34,p,34,10);return 0;}        | Try it!!

To subscribe / unsubscribe goto the site www.ilug-bom.org ., click on the mailing list 
button and fill the appropriate information 
and submit. For any other queries contact the ML maintener

Reply via email to