Re: fseek and open_memstream



In article <epqett$1k9e$1@xxxxxxxxxxxxxxxxx>,
Dmitry Belous <dmitry_belous@xxxxx> wrote:
Why when I uncomment fseek line buf become empty?

#define _GNU_SOURCE
#include <stdio.h>

int main() {
char *buf = 0;
int size = 0;
FILE* f = open_memstream(&buf, &size);

What is open_memstream() ? It is not part of C89, and I've never
heard of it being part of C99.

fwrite("test", 1, 4, f);
// fseek(f, 0, SEEK_SET);
fclose(f);
fprintf(stderr, buf);
}

You appear to be using an implementation library function. You
will need to ask in a location that specializes in your implementation.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
.