blob: acd7f5bb386f268c1dbd07c018e378895fbdb722 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<h1 id="firstHeading" class="firstHeading">fgetws</h1> <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code><wchar.h></code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl t-since-c95 t-until-c99"> <td> <pre data-language="c">wchar_t* fgetws( wchar_t* str, int count, FILE* stream );</pre>
</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c95">(since C95)</span> <br><span class="t-mark-rev t-until-c99">(until C99)</span> </td> </tr> <tr class="t-dcl t-since-c99"> <td> <pre data-language="c">wchar_t* fgetws( wchar_t* restrict str, int count, FILE* restrict stream );</pre>
</td> <td class="t-dcl-nopad"> </td> <td> <span class="t-mark-rev t-since-c99">(since C99)</span> </td> </tr> </table> <p>Reads at most <code>count - 1</code> wide characters from the given file stream and stores them in <code>str</code>. 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 <code>str</code> will contain that wide newline character.</p>
<h3 id="Parameters"> Parameters</h3> <table class="t-par-begin"> <tr class="t-par"> <td> str </td> <td> - </td> <td> wide string to read the characters to </td>
</tr> <tr class="t-par"> <td> count </td> <td> - </td> <td> the length of <code>str</code> </td>
</tr> <tr class="t-par"> <td> stream </td> <td> - </td> <td> file stream to read the data from </td>
</tr>
</table> <h3 id="Return_value"> Return value</h3> <p><code>str</code> on success, a null pointer on an error</p>
<h3 id="Example"> Example</h3> <h3 id="References"> References</h3> <ul>
<li> C23 standard (ISO/IEC 9899:2023): </li>
<ul><li> 7.29.3.2 The fgetws function (p: TBD) </li></ul>
<li> C17 standard (ISO/IEC 9899:2018): </li>
<ul><li> 7.29.3.2 The fgetws function (p: TBD) </li></ul>
<li> C11 standard (ISO/IEC 9899:2011): </li>
<ul><li> 7.29.3.2 The fgetws function (p: 422) </li></ul>
<li> C99 standard (ISO/IEC 9899:1999): </li>
<ul><li> 7.24.3.2 The fgetws function (p: 367-368) </li></ul>
</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="fwscanf" title="c/io/fwscanf"> <span class="t-lines"><span>wscanf</span><span>fwscanf</span><span>swscanf</span><span>wscanf_s</span><span>fwscanf_s</span><span>swscanf_s</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-c95">(C95)</span></span><span><span class="t-mark-rev t-since-c95">(C95)</span></span><span><span class="t-mark-rev t-since-c95">(C95)</span></span><span><span class="t-mark-rev t-since-c11">(C11)</span></span><span><span class="t-mark-rev t-since-c11">(C11)</span></span><span><span class="t-mark-rev t-since-c11">(C11)</span></span></span></div> </td> <td> reads formatted wide character input from <code><a href="std_streams" title="c/io/std streams">stdin</a></code>, a file stream or a buffer <br> <span class="t-mark">(function)</span> </td>
</tr> <tr class="t-dsc"> <td> <div><a href="fgetwc" title="c/io/fgetwc"> <span class="t-lines"><span>fgetwc</span><span>getwc</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-c95">(C95)</span></span></span></div> </td> <td> gets a wide character from a file stream <br> <span class="t-mark">(function)</span> </td>
</tr> <tr class="t-dsc"> <td> <div><a href="fputws" title="c/io/fputws"> <span class="t-lines"><span>fputws</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-c95">(C95)</span></span></span></div> </td> <td> writes a wide string to a file stream <br> <span class="t-mark">(function)</span> </td>
</tr> <tr class="t-dsc"> <td> <div><a href="https://en.cppreference.com/w/c/experimental/dynamic/getline" title="c/experimental/dynamic/getline"> <span class="t-lines"><span>getline</span><span>getwline</span><span>getdelim</span><span>getwdelim</span></span></a></div>
<div><span class="t-lines"><span><span class="t-mark-rev t-since-dynamic-tr t-mark-ts">(dynamic memory TR)</span></span></span></div> </td> <td> read from a stream into an automatically resized buffer until delimiter/end of line <br> <span class="t-mark">(function)</span> </td>
</tr> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/io/c/fgetws" title="cpp/io/c/fgetws">C++ documentation</a></span> for <code>fgetws</code> </td>
</tr> </table> <div class="_attribution">
<p class="_attribution-p">
© cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
<a href="https://en.cppreference.com/w/c/io/fgetws" class="_attribution-link">https://en.cppreference.com/w/c/io/fgetws</a>
</p>
</div>
|