From 82ba818ff456bcd6d56a06226e3f27e98fbb55c3 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 14 Aug 2025 22:58:58 -0500 Subject: removing all downloaded devdocs files --- devdocs/c/io%2Ffgetwc.html | 75 ---------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 devdocs/c/io%2Ffgetwc.html (limited to 'devdocs/c/io%2Ffgetwc.html') diff --git a/devdocs/c/io%2Ffgetwc.html b/devdocs/c/io%2Ffgetwc.html deleted file mode 100644 index c17f187d..00000000 --- a/devdocs/c/io%2Ffgetwc.html +++ /dev/null @@ -1,75 +0,0 @@ -

fgetwc, getwc

Defined in header <wchar.h>
wint_t fgetwc( FILE *stream );
-
(since C95)
wint_t getwc( FILE *stream );
-
(since C95)

Reads the next wide character from the given input stream. getwc() may be implemented as a macro and may evaluate stream more than once.

-

Parameters

- -
stream - to read the wide character from

Return value

The next wide character from the stream or WEOF on failure.

-

If the failure has been caused by end-of-file condition, additionally sets the eof indicator (see feof()) on stream. If the failure has been caused by some other error, sets the error indicator (see ferror()) on stream.

-

If an encoding error occurred, additionally sets errno to EILSEQ.

-

Example

#include <stdio.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <errno.h>
-#include <locale.h>
- 
-int main(void)
-{
-    setlocale(LC_ALL, "en_US.utf8");
-    FILE *fp = fopen("fgetwc.dat", "w");
-    if(!fp) {
-        perror("Can't open file for writing");
-        return EXIT_FAILURE;
-    }
-    fputs("кошка\n", fp);
-    fclose(fp);
- 
-    fp = fopen("fgetwc.dat", "r");
-    if(!fp) {
-        perror("Can't open file for reading");
-        return EXIT_FAILURE;
-    }
-    wint_t wc;
-    errno = 0;
-    while ((wc = fgetwc(fp)) != WEOF)
-        putwchar(wc);
- 
-    if (ferror(fp)) {
-        if (errno == EILSEQ)
-            puts("Character encoding error while reading.");
-        else
-            puts("I/O error when reading");
-    } else if (feof(fp))
-        puts("End of file reached successfully");
- 
-    fclose(fp);
-}

Output:

-
кошка

References

See also

- - - - -
gets a character from a file stream
(function)
-
(C95)
gets a wide string from a file stream
(function)
-
(C95)
writes a wide character to a file stream
(function)
-
(C95)
puts a wide character back into a file stream
(function)
C++ documentation for fgetwc
-

- © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
- https://en.cppreference.com/w/c/io/fgetwc -

-
-- cgit v1.2.3