Skip to content

Instantly share code, notes, and snippets.

@simonliu009
Last active December 25, 2019 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonliu009/a9a6bc43747a3c6d81036e6f5e7a5afe to your computer and use it in GitHub Desktop.
Save simonliu009/a9a6bc43747a3c6d81036e6f5e7a5afe to your computer and use it in GitHub Desktop.
[string to int/string to float]strtol #c
]
strtol, strtoll, strtoq - convert a string to a long integer
atoi, atol, atoll, atoq - convert a string to an integer
atof() - convert a string to a float
Synopsis
#include <stdlib.h>
long int strtol(const char *nptr, char **endptr, int base);
long long int strtoll(const char *nptr, char **endptr, int base);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
atoi()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment