/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* This is an example of the function fgetws(wchar_t*, int, FILE *).
   This will retrieve an entire string of the max length specifed by the user
   from an input stream.
*/
#include <wchar.h>

int main() { 
    FILE *stream;
    int i;
    wchar_t str[100];

    i =10;
    printf("Retrieving a string of length %d from \"Makefile\".\n", i);
    if((stream = fopen("Makefile", "r")) != NULL) {
    	fgetws(str, i, stream);
        fputws(str, stdout);
        fputs("\n", stdout); 
    }
    else
        printf("Error in opening file!\n");
    fclose(stream);
}

