GETWC(3P)

πŸŽ€ GETWC(3P) β€” POSIX Programmer's Manual πŸŽ€

okay bestie, we're in the POSIX Programmer's Manual rn, and this lil page is all about getwc β€” she's the one who grabs a wide character off a stream for you πŸ’–


✨ PROLOG ✨

so like, this manual page is part of the POSIX Programmer's Manual. and here's the tea: the Linux implementation of this interface may differ β€” if you're on Linux, go peek at the corresponding Linux manual page for the actual Linux behavior, mkay? or honestly the interface might just not be implemented on Linux at all. no cap, that's a real possibility. πŸ’€


🌸 NAME 🌸

getwc β€” get a wide character from a stream ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

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

wint_t getwc(FILE *stream);

πŸ’… DESCRIPTION πŸ’…

the functionality described on this reference page is aligned with the ISO C standard. any conflict between the requirements described here and the ISO C standard? unintentional, bestie. this volume of POSIX.1‐2017 defers to the ISO C standard. periodt.

the getwc() function shall be equivalent to fgetwc(), EXCEPT β€” and this is the important part β€” if it is implemented as a macro, it may evaluate stream more than once. so like… the argument should never be an expression with side-effects. fr fr. πŸ™ˆ


⭐ RETURN VALUE ⭐

refer to fgetwc(). that's it. she's passing the buck, respectfully πŸ’…


πŸ”₯ ERRORS πŸ”₯

refer to fgetwc().

the following sections are informative. iykyk.


🌈 EXAMPLES 🌈

none. 😭 not a single one. we move.


πŸ“ APPLICATION USAGE πŸ“

since it may be implemented as a macro, getwc() may treat a stream argument with side-effects incorrectly. in particular:

getwc(*f++)

does not necessarily work as expected. so therefore… use of this function is not recommended. bestie, just use fgetwc() instead. i'm literally begging you. 🫢


🧚 RATIONALE 🧚

none.


πŸ‘‘ FUTURE DIRECTIONS πŸ‘‘

none.


πŸ’œ SEE ALSO πŸ’œ

  • Section 2.5, Standard I/O Streams, fgetwc()
  • The Base Definitions volume of POSIX.1‐2017, <stdio.h>, <wchar.h>

portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. in the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. the original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


🌟 and that's the whole page, bestie! this one came from IEEE/The Open Group, 2017 β€” GETWC(3P), she's an icon, she's a legend, and she is the moment. mwah πŸ’‹βœ¨ (also fr, use fgetwc(). i love you. 🫢)
πŸ“¦ where this page comes from