/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that reads a file then 
displays it's content. */
#include <stdio.h>
#include <stdlib.h>

int main() {
    FILE *stream;
    char buffer[BUFSIZ], ch;
    
    /* open file for reading only */
    if((stream=fopen("setbuf.c","r")) == NULL) { 
        printf("cannot open file\n");
        exit(1);
    }
    setbuf(stream,buffer); /* associate a buffer with the stream */
    ch = fgetc(stream);
    printf("%c\n",ch);
    fclose(stream);
}
