HELPLIB.HLB  —  CRTL  fgetws  Example
        #include <stdlib.h>
        #include <stdio.h>
        #include <locale.h>
        #include <wchar.h>

        main()
        {
            wchar_t wstr[80],
                   *ret;
            FILE *fp;

            /* Create a dummy data file  */

            if ((fp = fopen("file.dat", "w+")) == NULL) {
                perror("open");
                exit(1);
            }

            fprintf(fp, "this is a test\n") ;
            fclose(fp) ;

           /* Open a test file containing : "this is a test" */

            if ((fp = fopen("file.dat", "r")) == (FILE *) NULL) {
                perror("File open error");
                exit(EXIT_FAILURE);
            }

            ret = fgetws(wstr, 80, fp);
            if (ret == (wchar_t *) NULL) {
                perror("fgetws failure");
                exit(EXIT_FAILURE);
            }

            fputws(wstr, stdout);
            fclose(fp);
            delete("file.dat");
        }
Close Help