std::fgetpos(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… std::fgetpos(3) β€” C++ Standard Libary πŸ’…

okay bestie, we are in the C++ Standard Libary manual, page std::fgetpos(3), and this one is short but lowkey iconic. Let’s get into it ✨

πŸ’– NAME πŸ’–

std::fgetpos β€” std::fgetpos. That’s the name. That’s the whole name. periodt πŸ’…

🌸 Synopsis 🌸

Defined in header <cstdio>.

int fgetpos( std::FILE* stream, std::fpos_t* pos );

So what does it do? It obtains the file position indicator and the current parse state (if any) for the file stream stream, and stores them in the object pointed to by pos. The value stored is only meaningful as the input to std::fsetpos. Like, do not try to read it as some normal number, bestie β€” that is not the vibe check it passes 😭

πŸŽ€ Parameters πŸŽ€

  • stream β€” the file stream to examine.
  • pos β€” pointer to a fpos_t object to store the file position indicator to.

✨ Return value ✨

Returns 0 upon success, nonzero value otherwise. Also sets errno on failure. So yeah, check that return value and check errno, no cap 🫢

πŸ¦‹ Example πŸ¦‹

This section is incomplete.

Reason: no example.

not the incomplete example section 😭 it’s giving β€œtrust me bestie, imagine a file stream here” πŸ’€

🌈 See also 🌈

  • ftell β€” returns the current file position indicator (function)
  • fseek β€” moves the file position indicator to a specific location in a file (function)
  • fsetpos β€” moves the file position indicator to a specific location in a file (function)
  • C documentation for fgetpos

πŸ‘‘ Category πŸ‘‘

  • * Todo no example

and that’s the page, bestie πŸ’– source/version/date check: http://cppreference.com Β· 2024.06.10 Β· std::fgetpos(3) β€” bye, slay, and may your file positions be exactly where you left them πŸŽ€βœ¨

πŸ“¦ where this page comes from