/* 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[500], ch;
    size_t size = 500; 
    
    /* open file for reading only */
    if((stream=fopen("setvbuf.c","r")) == NULL){ 
      printf("cannot open file\n");
      exit(1);
    }
    setvbuf(stream,buffer,_IOFBF,size); /* associate a buffer with the stream */
    ch = fgetc(stream);
    printf("%c\n",ch);
    fclose(stream);
}
