/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* This is an example of the function ungetwc(wint_t, FILE *).  This pushes 
   a character back onto the stream.
*/
#include <wchar.h>

int main() { 
    FILE *stream;
    wint_t wc;

    if((stream = fopen("ungetwc.c", "r")) != NULL) {
        wc = fgetwc(stream);
        printf("ungetwc(wc,stream) = ");
        fputwc( ungetwc(wc,stream), stdout);
        printf("\n");
    }
    else
        printf("Error in opening file!\n");
    fclose(stream);
}

