CSE598/494 System-Level Hardware-Software Codesign

From esoterum.org
Revision as of 14:55, 11 April 2008 by Baker (Talk | contribs) (Paper Presentation)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Paper Presentation

JPEG

Xilinx

Project 2

Here is an example of using `fmemopen' to create a stream for
reading from a string:

#include <stdio.h> 

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;
}

This program produces the following output: 

Got f
Got o
Got o
Got b
Got a
Got r