[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Help with glibc memory streams



On Mon, Oct 30, 2000 at 06:35:11AM +0100 , Andreas Fuchs wrote:
> I beg to differ.
> 
> #include <stdio.h>
> 
> int main()
> {
>    char *str = "test\nbar\n";
>    char c;
     ^^^^ int

>    FILE *stream;
> 
>    stream = fmemopen(str, strlen(str), "r");
>    while (EOF != (c = fgetc(stream)) && !ferror (stream)) {

int fgetc (FILE *STREAM)

>       putchar (c);

int putchar (int C)

>    }
>    if (ferror (stream))
>            fprintf (stderr, "ferror!\n");
>    if (feof (stream))
>            fprintf (stderr, "feof!\n");
>    fclose(stream);
>    return 0;
> }

				Petr Cech
-- 
Debian GNU/Linux maintainer - www.debian.{org,cz}
           cech@atrey.karlin.mff.cuni.cz

* Joy notes some people think "Unix" is a misspelling of "Unics" which is a misspelling of "Emacs" :)



Reply to: