STRTON(3)

πŸ“¦ version 93vu, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so bestie, welcome to STRTON(3) β€” this icon converts a string to a long integer, and honestly she’s giving parser main-character energy ✨

🌸 SYNOPSIS 🌸

long strton(char* s, char** e)

πŸŽ€ DESCRIPTION πŸŽ€

strton converts the nul-terminated string s to a long integer. If e is not 0, then *e gets set to point to the first unrecognized character in s. Leading spaces in s are ignored β€” yes, she’s polite like that πŸ’…

A number is composed of sign-base-number-suffix. All of those parts except number are optional, so don’t panic. The sign may be + or -.

The base may be:

  • 0x β€” for hexadecimal;
  • 0 β€” for octal; or
  • nn# β€” for base 2 ≀ nn ≀ 36.

For bases greater than 10, the additional digits are taken from the set [a-zA-Z] β€” lowercase and uppercase both pulling up, periodt πŸ‘‘

The suffix multiplies the converted number and may be:

  • b β€” block (512)
  • g β€” giga (1024 * 1024 * 1024)
  • k β€” kilo (1024)
  • m β€” mega (1024 * 1024)

πŸ¦‹ SEE ALSO πŸ¦‹

atoi(3), scanf(3), strtod(3)


That’s the STRTON(3) page, bestie β€” signing off with all the STRTON(3) footer vibes and zero missing details πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from