Welcome! Log In Create A New Profile


fwrite question ?

Posted by damato68 
fwrite question ?
December 06, 2012 03:50PM
Hi, I've a buffer from a variable string and I need to write a block of bytes from it to file.
Is there a way to do that ?
I can't pass the pointer to the fwrite ?
The only way I see for the moment is to copy byte to byte from the buffer to a string and then write it but....

Edited 1 time(s). Last edit at 12/06/2012 03:50PM by damato68.
Re: fwrite question ?
December 07, 2012 09:05AM
the reason a string is used in fwrite is because it is used in fread. A string contains its size and so when reading the buffer can't be exceeded by accident. So fwrite is just the opposite of fread.
There may be some improvements needed around file access, open to suggestions for the next update.
Sorry, you do not have permission to post/reply in this forum.