SSCANF(3POSIX)

πŸ¦‹ sscanf(3POSIX) β€” the POSIX Programmer's Manual, bestie edition πŸ¦‹

okay so real talk: this page is part of the POSIX Programmer's Manual ✨ and it's the short one, so we can just hang out for a sec.


✨ PROLOG ✨

okay so before literally anything else, bestie, read this:

  • This manual page is part of the POSIX Programmer's Manual.
  • The Linux implementation of this interface may differ β€” so if you're on Linux, go consult the corresponding Linux manual page for the actual deets on Linux behavior. πŸ‘€
  • Or, plot twist, the interface may not be implemented on Linux at all. 😭
not me finding out the hard way that "POSIX says so" and "your kernel does so" are two different vibes. always check both, fr fr.

πŸ’– NAME πŸ’–

sscanf β€” convert formatted input

like, it takes your string and parses it. icon behavior.


🌸 SYNOPSIS 🌸

#include <stdio.h>

int sscanf(const char *restrict s, const char *restrict format, ...);

so you got your string s (restricted, don't be messy about it), your format (also restricted, respect the contract 🫢), and then ... β€” the variadic era, the main character energy, all the pointers you're about to fill. πŸ’…


🌈 DESCRIPTION 🌈

Refer to fscanf().

that's it. that's the whole description. the POSIX girlies really said "go read the other page" and honestly? valid. sscanf is just fscanf but the "file" is a string. same format specifiers, same drama, same everything. go read fscanf() for the real tea. πŸ“


okay legal moment, no skipping, this all matters:

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. ✨ (translation: if we beef, the original wins, periodt.)

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 .

ngl if you spot a typo it's probably the conversion's fault, not the standard's β€” snitch to the kernel.org link above and they'll handle it. πŸ’€

and that's the whole page, bestie!! short, sweet, and every single fact intact. πŸ’œ

mwah πŸ’‹ this one's from IEEE/The Open Group, 2017 β€” yeah that's the footer energy, we're out here citing our sources like the academic baddies we are. πŸŽ€