c++ - Can I read stream produced by open_memstream()? -
i create stream open_memstream(), fill , read. works fine. i'm confused function documentation says: "the open_memstream() function opens stream writing buffer". can read too. use in proper way? maybe can read stream because of function implementation in platform allows that? , when change platform error.
but can read too. use in proper way?
no, not really. posix specifies open_memstream() output only. you're supposed write it. can access data write via buffer created open_memstream(), not fread(), fgets() or similar.
use fmemopen() if want stream can read too.
maybe can read stream because of function implementation in platform allows that?
yes, might feature of implementation allows read file* too, check documentation.
Comments
Post a Comment