ustrtol (3) - Linux Manuals
ustrtol: Converts a string into an integer. Allegro game programming library.
Command to display ustrtol
manual in Linux: $ man 3 ustrtol
NAME
ustrtol - Converts a string into an integer. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
long ustrtol(const char *s, char **endp, int base);
DESCRIPTION
This function converts the initial part of `s' to a signed integer, setting
`*endp' to point to the first unused character, if `endp' is not a NULL
pointer. The `base' argument indicates what base the digits (or letters)
should be treated as. If `base' is zero, the base is determined by looking
for `0x', `0X', or `0' as the first part of the string, and sets the base
used to 16, 16, or 8 if it finds one. The default base is 10 if none of
those prefixes are found. Example:
char *endp, *string = "456.203 askdfg";
int number = ustrtol(string, &endp, 10);
RETURN VALUE
Returns the string converted as a value of type `long int'. If nothing was
converted, returns zero with `*endp' pointing to the beginning of `s'.
Pages related to ustrtol
- ustrtod (3) - Converts a string into a floating point number. Allegro game programming library.
- ustrtok (3) - Retrieves tokens from a string. Allegro game programming library.
- ustrtok_r (3) - Reentrant function to retrieve tokens from a string. Allegro game programming library.
- ustr (3) - ustr string library functions
- ustr_const (3) - ustr string library constants
- ustrcat (3) - Concatenates a string to another one. Allegro game programming library.
- ustrchr (3) - Finds the first occurrence of a character in a string. Allegro game programming library.
- ustrcmp (3) - Compares two strings. Allegro game programming library.
- ustrcpy (3) - Copies a string into another one. Allegro game programming library.