/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* This is an example for the function getwc(FILE *).  This retrieves a wide
   character from the input stream.
*/
#include <wchar.h>

int main() { 
    FILE *stream;
    int i;
    wint_t ch;
    
    printf("Retrieves the first 10 characters from the file ""wctype.c"".\n"); 
    if((stream = fopen("getwc.c", "r")) != NULL) {
 	for(i =0; i<10; i++) {
           ch = getwc(stream);
     	   fputwc(ch, stdout);
    	}
        printf("\n");
    }
    else
        printf("Error in opening file!\n");
    fclose(stream);
}

