##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::fgetws

From cppreference.com
< cpp‎ | io‎ | c

Defined in header `<cwchar>` |  |
wchar_t* fgetws( wchar_t* str, int count, std::FILE* stream ); |  |

Reads at most count - 1 wide characters from the given file stream and stores them in `str`. The produced wide string is always null-terminated. Parsing stops if end-of-file occurs or a newline wide character is found, in which case `str` will contain that wide newline character.

### [edit] Parameters

str | - | wide string to read the characters to
count | - | the length of `str`
stream | - | file stream to read the data from

### [edit] Return value

`str` on success, NULL on an error

### [edit] See also

wscanf fwscanf swscanf | reads formatted wide character input from stdin, a file stream or a buffer (function) [edit]
fgetwc getwc | gets a wide character from a file stream (function) [edit]
fputws | writes a wide string to a file stream (function) [edit]
C documentation for fgetws

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/io/c/fgetws&oldid=74490"