From 28f540f45bbacd939bfd07f213bcad2bf730b1bf Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 18 Feb 1995 01:27:10 +0000 Subject: initial import --- manual/examples/memopen.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 manual/examples/memopen.c (limited to 'manual/examples/memopen.c') diff --git a/manual/examples/memopen.c b/manual/examples/memopen.c new file mode 100644 index 0000000..682830f --- /dev/null +++ b/manual/examples/memopen.c @@ -0,0 +1,17 @@ +#include + +static char buffer[] = "foobar"; + +int +main (void) +{ + int ch; + FILE *stream; + + stream = fmemopen (buffer, strlen (buffer), "r"); + while ((ch = fgetc (stream)) != EOF) + printf ("Got %c\n", ch); + fclose (stream); + + return 0; +} -- cgit v1.1