Back to index

glibc  2.9
memstrm.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 
00003 int
00004 main (void)
00005 {
00006   char *bp;
00007   size_t size;
00008   FILE *stream;
00009 
00010   stream = open_memstream (&bp, &size);
00011   fprintf (stream, "hello");
00012   fflush (stream);
00013   printf ("buf = `%s', size = %d\n", bp, size);
00014   fprintf (stream, ", world");
00015   fclose (stream);
00016   printf ("buf = `%s', size = %d\n", bp, size);
00017 
00018   return 0;
00019 }