An easy way to replace fread()'s with reading from a byte array?

Posted by Sam Washburn on Stack Overflow See other posts from Stack Overflow or by Sam Washburn
Published on 2010-05-04T05:59:14Z Indexed on 2010/05/04 6:38 UTC
Read the original article Hit count: 220

Filed under:
|
|
|

I have a piece of code that needs to be run from a restricted environment that doesn't allow stdio (Flash's Alchemy compiler). The code uses standard fopen/fread functions and I need to convert it to read from a char* array. Any ideas on how to best approach this? Does a wrapper exist or some library that would help?

Thanks!

EDIT: I should also mention that it's reading in structs. Like this:

fread(&myStruct, 1, sizeof(myStruct), f);

© Stack Overflow or respective owner

Related posts about c

    Related posts about fread