jgharston <> writes:
> Try replacing:
>> Â* Â* Â* Â* while((c = fgetc(f)) != EOF) {
>> Â* Â* Â* Â* Â* Â* Â* Â* fputc(c, ftmp);
>> Â* Â* Â* Â* }
>
> with:
> bsize=m_free(0);
> buff=m_alloc(bsize);
> numread=-1;
>
> while(numread) {
> numread=fread(buff,1,bsize,f);
> fwrite(buff,1,numread,ftmp);
> }
> m_free(buff);
>
> As with usenet tradition, completely untested.
Leaving aside the m_free and m_alloc calls, why do you assume that this
will be significantly faster than the fgetc/fputc loop? stdio does its
own buffering.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"