STRCHR(3POSIX)

πŸ’– STRCHR(3POSIX) β€” the POSIX Programmer's Manual, bestie edition πŸ’–

okay so quick heads up before we even start: this page lives in the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” like, go check the matching Linux man page for the actual Linux tea β€” or honestly the interface might not even be implemented on Linux at all. πŸ™ˆ


✨ PROLOG ✨

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.


🌸 NAME 🌸

strchr β€” string scanning operation. that's the whole vibe: we scan a string. πŸ”


πŸŽ€ SYNOPSIS πŸŽ€

#include <string.h>

char *strchr(const char *s, int c);

πŸ¦‹ DESCRIPTION πŸ¦‹

So 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 is unintentional β€” no drama intended, fr fr. This volume of POSIX.1‐2017 defers to the ISO C standard. πŸ‘‘

Now the actual main character move: the strchr() function shall locate the first occurrence of c (converted to a char) in the string pointed to by s. And listen β€” the terminating NUL character is considered to be part of the string. So yes, it counts. Not me including the null terminator in the group chat πŸ’€


πŸ’… RETURN VALUE πŸ’…

Upon completion, strchr() shall return a pointer to the byte, or a null pointer if the byte was not found. found it = pointer, didn't find it = NULL. simple as that, periodt.


πŸ’€ ERRORS πŸ’€

No errors are defined.

The following sections are informative.


πŸ“ EXAMPLES πŸ“

None. literally nothing. empty. the void. πŸ«₯


🧚 APPLICATION USAGE 🧚

None. also nothing. we're keeping it minimal, iykyk.


🌈 RATIONALE 🌈

None. (do you see the pattern bestie, these are all informative sections and they are all empty πŸ’œ)


⭐ FUTURE DIRECTIONS ⭐

None.


πŸ”₯ SEE ALSO πŸ”₯

  • strrchr()
  • The Base Definitions volume of POSIX.1‐2017, <string.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. So like, if there's beef, the original wins. no cap.

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 to you courtesy of IEEE/The Open Group, 2017 β€” the very last line of the original, now serving as my lil sign-off. mwah, go scan some strings responsibly πŸ’–πŸ¦‹πŸ’