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 - get wide character string from stream

&pagelevel(4)&pagelevel

Syntax

#include <wchar.h>

Optional
#include <stdio.h> (End)

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

Description fgetws() reads characters from stream, converts these 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, converted and transferred to ws, 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 stream is
indeterminate.

Restriction
This version of the C runtime system only supports 1-byte characters as wide character
codes. They are of type wchar_t (see stddef.h). (End)

fgetws() can mark the structure component st_atime for the file to which stream is
assigned for changing (see sys/stat.h). The structure component st_atime is updated
as soon as fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(),
getc(), getchar(), gets() or scanf() are called successfully for stream and return
data which is not was not provided by a preceding call to ungetc() or ungetwc().

BS2000

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 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 (End).

Return val.

ws

Null pointer

Null pointer

upon successful completion.

if the stream is at end-of-file. The end-of-file indicator for the stream is set.

if a read error occurs. The error indicator for the stream is set, and errno is
set to indicate the error.

Errors

See also

See fgetwc().

fgetwc(), fopen(), fread(), stdio.h, wchar.h.