/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/*  This is an example of the function fwide(FILE *, int).  The function will
    alter the stream according to the desired mode.
*/
#include <wchar.h>

int main() {
    FILE *stream;
    int c,retval;

    c = 11; 
    if((stream = fopen("fwide.c", "r")) != NULL)
    {
        retval = fwide(stream, c);
        if(retval < 0)
            printf("Stream has byte orientation.\n");
        else if(retval > 0)
            printf("Stream has wide orientation.\n");
        else
            printf("Stream has no orientation.\n");
    }
    else
        printf("Error in opening file!\n");
    fclose(stream);
}

