I would like to read from a file into an unsigned character buffer as well as write that information back into a file. I am using an unsigned character buffer because I need to send this information over a UDP socket.
The problem is I can’t seem to find a way to properly read the file from the buffer and write from the buffer.
Can anyone point a way to do this?
Thanks so much
Take a look at
writeandreadfunctions, orfreadandfwrite. They should do the trick.For example, you write a buffer to a file with:
The
writefunction may return some error codes, so read it’s manual.fwriteis very similar in usage, look at the site here.