Back to index

glibc  2.9
memopen.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 
00003 static char buffer[] = "foobar";
00004 
00005 int
00006 main (void)
00007 {
00008   int ch;
00009   FILE *stream;
00010 
00011   stream = fmemopen (buffer, strlen (buffer), "r");
00012   while ((ch = fgetc (stream)) != EOF)
00013     printf ("Got %c\n", ch);
00014   fclose (stream);
00015 
00016   return 0;
00017 }