Re: Faster way to write in a file
- From: "Malcolm McLean" <regniztar@xxxxxxxxxxxxxx>
- Date: Wed, 13 Feb 2008 16:41:29 -0000
"LilacSkin" <lpaulo07@xxxxxxx> wrote in message news
Hi,Replace %lli with %llx and measure the speedup.
Currently, I write an signed long long in a file with the fprintf
function:
signed long long * pData = NULL;
unsigned long long k = 0;
unsigned long DataAvail = 0 ;
pDataRx = (signed long long *) malloc ( sizeof(signed long long ) *
(65536*16*8) / 8);
for ( k = 0; k < DataAvail/8; k ++ ) {
fprintf ( pFilec, "%lli\t", pData[k]);
}
The problem is that function is very very slow !
In several forums, I saw that fwrite function is better, but I don't
know how to use it.
Can you help me, please ?
Is hexadecimal output acceptable to you?
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
.
- References:
- Faster way to write in a file
- From: LilacSkin
- Faster way to write in a file
- Prev by Date: Re: Faster way to write in a file
- Next by Date: Re: Dereference an array pointer... UB?
- Previous by thread: Re: Faster way to write in a file
- Next by thread: question on union
- Index(es):
Relevant Pages
|