Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

fgetws - Read a wide character string from a file

&pagelevel(4)&pagelevel

Definition

#include <wchar.h>
#include <stdio.h>

wchar_t * fgetws(wchar_t *ws, int n, FILE *fp);

fgetws reads characters from the file pointed to by fp, converts them to the
corresponding wide character codes, and places them in the wchar_t array pointed to by
ws, until n-1 characters are read, or a newline character is read, or an end-of-file condition
is encountered. The wide character string ws is then terminated with a null wide-character
code.

If an error occurs, the resulting value of the file position indicator for the file is
indeterminate

Return val.

Pointer to the resulting wide character string ws

if successful.

NULL pointer

if end-of-file is reached. The end-of-file indicator for the file is set;
or
if a read error occurs. The error indicator for the file is set, and errno is set
to EBADF if fp is an invalid file pointer.

Note

This version of the C runtime system only supports one-byte characters as wide character
codes.

The following applies in the case of text files with SAM access mode and variable record
length for which a maximum record length is also specified: When the specification
split=no was entered for fopen, records of maximum record length are not concatenated
with the subsequent record when they are read. By default or with the specification
split=yes, when a record with maximum record length is read, it is assumed that the
following record is the continuation of this record and the records are concatenated.

See also

fgetwc, fopen, fopen64, fread