# <stdlib.h> <stdlib.h> # `` * * * **`EXIT_FAILURE· EXIT_SUCCESS· MB_CUR_MAX· NULL· RAND_MAX`** **`abort· abs· atexit· atof· atoi· atol· atoll· bsearch· calloc· div· div_t· _Exit· exit· free· getenv· labs· llabs· ldiv· ldiv_t· ldiv· ldiv_t· malloc· mblen· mbstowcs· mbtowc· qsort· rand· realloc· size_t· srand· strtod· strtof· strtol· strtold· strtoll· strtoul· strtoull· system· wchar_t· wcstombs· wctomb`** * * * Include the standard header **``** to declare an assortment of useful functions and to define the macros and types that help you use them. /* MACROS */ #define EXIT_FAILURE #define EXIT_SUCCESS #define MB_CUR_MAX = 1> #define NULL [0 in C++] #define RAND_MAX = 32,767> /* TYPES */ typedef struct { int quot, rem; } div_t; typedef struct { long quot, rem; } ldiv_t; typedef struct { [added with C99] long long quot, rem; } lldiv_t; typedef ui-type size_t; typedef i-type wchar_t; [keyword in C++] /* FUNCTIONS */ int abs(int i); long abs(long i); [C++ only] long long abs(long long i); [C++ only, added with C99] long long llabs(long long i); [added with C99] long labs(long i); div_t div(int numer, int denom); ldiv_t div(long numer, long denom); [C++ only] lldiv_t div(long long numer, long long denom); [C++ only, added with C99] lldiv_t lldiv(long long numer, long long denom); [added with C99] ldiv_t ldiv(long numer, long denom); int rand(void); void srand(unsigned int seed); double atof(const char *s); int atoi(const char *s); long atol(const char *s); long long atoll(const char *s); [added with C99] double strtod(const char *restrict s, char **restrict endptr); float strtof(const char *restrict s, char **restrict endptr); [added with C99] long double strtold(const char *restrict s, char **restrict endptr); [added with C99] long long strtoll(const char *restrict s, char **restrict endptr, int base); [added with C99] unsigned long long strtoull(const char *restrict s, char **restrict endptr, int base); [added with C99] long strtol(const char *restrict s, char **restrict endptr, int base); unsigned long strtoul(const char *restrict s, char **restrict endptr, int base); void *calloc(size_t nelem, size_t size); void free(void *ptr); void *malloc(size_t size); void *realloc(void *ptr, size_t size); int mblen(const char *s, size_t n); size_t mbstowcs(wchar_t *restrict wcs, const char *restrict s, size_t n); int mbtowc(wchar_t *restrict pwc, const char *restrict s, size_t n); size_t wcstombs(char *restrict s, const wchar_t *restrict wcs, size_t n); int wctomb(char *s, wchar_t wchar); void _Exit(int status); [added with C99] void exit(int status); void abort(void); char *getenv(const char *name); int system(const char *s); extern "C++" int atexit(void (*func)(void)); [C++ only] extern "C" [C++ only] int atexit(void (*func)(void)); extern "C++" void *bsearch(const void *key, const void *base, size_t nelem, size_t size, int (*cmp)(const void *ck, const void *ce)); [C++ only] extern "C" [C++ only] void *bsearch(const void *key, const void *base, size_t nelem, size_t size, int (*cmp)(const void *ck, const void *ce)); extern "C++" void qsort(void *base, size_t nelem, size_t size, int (*cmp)(const void *e1, const void *e2)); [C++ only] extern "C" [C++ only] void qsort(void *base, size_t nelem, size_t size, int (*cmp)(const void *e1, const void *e2));Copy to clipboard ## `abort` void abort(void);Copy to clipboard The function calls `raise(SIGABRT)`, which reports the abort signal, [`SIGABRT`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_signal.html#SIGABRT). Default handling for the abort signal is to cause abnormal program termination and report unsuccessful termination to the target environment. Whether or not the target environment flushes output streams, closes open files, or removes temporary files on abnormal termination is implementation defined. If you specify handling that causes [`raise`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_signal.html#raise) to return control to `abort`, the function calls `exit(EXIT_FAILURE)`, to report unsuccessful termination with [`EXIT_FAILURE`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#EXIT_FAILURE). `abort` never returns control to its caller. ## `abs` int abs(int i); long abs(long i); [C++ only] long long abs(long long i); [C++ only, added with C99]Copy to clipboard The function returns the absolute value of `i`, `|i|`. The version that accepts a *long* argument behaves the same as [`labs`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#abs) ## `atexit` extern "C++" int atexit(void (*func)(void)); [C++ only] extern "C" [C++ only] int atexit(void (*func)(void));Copy to clipboard The function registers the function whose address is `func` to be called by [`exit`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#exit) (or when [`main`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_lib_over.html#main) returns) and returns zero if successful. The functions are called in reverse order of registry. You can register at least 32 functions. Furthermore, in C++, if control leaves a called function because it fails to handle a thrown exception, `terminate` is called. ## `atof` double atof(const char *s);Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *double* and then returns `x.` The conversion is the same as for `strtod(s, 0)`, except that a value is not necessarily stored in [`errno`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#errno) if a conversion error occurs. ## `atoi` int atoi(const char *s);Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *int* and then returns `x.` The conversion is the same as for `(int)strtol(s, 0, 10)`, except that a value is not necessarily stored in [`errno`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#errno) if a conversion error occurs. ## `atol` long atol(const char *s);Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *long* and then returns `x.` The conversion is the same as for `strtol(s, 0, 10)`, except that a value is not necessarily stored in [`errno`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#errno) if a conversion error occurs. ## `atoll` long long atoll(const char *s); [added with C99]Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *long long* and then returns `x.` The conversion is the same as for `strtoll(s, 0, 10)`, except that a value is not necessarily stored in [`errno`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#errno) if a conversion error occurs. ## `bsearch` extern "C++" void *bsearch(const void *key, const void *base, size_t nelem, size_t size, int (*cmp)(const void *ck, const void *ce)); [C++ only] extern "C" [C++ only] void *bsearch(const void *key, const void *base, size_t nelem, size_t size, int (*cmp)(const void *ck, const void *ce));Copy to clipboard The function searches an array of ordered values and returns the address of an array element that equals the search key `key` (if one exists); otherwise, it returns a null pointer. The array consists of `nelem` elements, each of `size` bytes, beginning with the element whose address is `base`. `bsearch` calls the comparison function whose address is `cmp` to compare the search key with elements of the array. The comparison function must return: - a negative value if the search key `ck` is less than the array element `ce` - zero if the two are equal - a positive value if the search key is greater than the array element `bsearch` assumes that the array elements are in nondescending order according to the same comparison rules that are used by the comparison function. ## `calloc` void *calloc(size_t nelem, size_t size);Copy to clipboard The function allocates an array object containing `nelem` elements each of size `size`, stores zeros in all bytes of the array, and returns the address of the first element of the array if successful; otherwise, it returns a null pointer. You can safely convert the return value to an object pointer of any type whose size in bytes is not greater than `size`. ## `div` div_t div(int numer, int denom); ldiv_t div(long numer, long denom); [C++ only] lldiv_t div(long long numer, long long denom); [C++ only, added with C99]Copy to clipboard The function divides `numer` by `denom` and returns both quotient and remainder in the structure result `x`, if the quotient can be represented. The structure member `x.quot` is the algebraic quotient truncated toward zero. The structure member `x.rem` is the remainder, such that `numer == x.quot*denom + x.rem`. ## `div_t` typedef struct { int quot, rem; } div_t;Copy to clipboard The type is the structure type returned by the function [`div`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#div). The structure contains members that represent the quotient (`quot`) and remainder (`rem`) of a signed integer division with operands of type *int.* The members shown above can occur in either order. ## `exit` void exit(int status);Copy to clipboard The function calls all functions registered by [`atexit`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#atexit), closes all files, and returns control to the target environment. If `status` is zero or [`EXIT_SUCCESS`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#EXIT_SUCCESS), the program reports successful termination. If `status` is [`EXIT_FAILURE`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#EXIT_FAILURE), the program reports unsuccessful termination. An implementation can define additional values for `status`. ## `_Exit` void _Exit(int status); [added with C99]Copy to clipboard The function returns control to the target environment. The value of `status` has the same effect as for a call to [`exit`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#exit). The function does *not* call functions registered by [`atexit`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#atexit). It may or may not close files. ## `EXIT_FAILURE` #define EXIT_FAILURE Copy to clipboard The macro yields the value of the `status` argument to [`exit`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#exit) that reports unsuccessful termination. ## `EXIT_SUCCESS` #define EXIT_SUCCESS Copy to clipboard The macro yields the value of the `status` argument to [`exit`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#exit) that reports successful termination. ## `free` void free(void *ptr);Copy to clipboard If `ptr` is not a null pointer, the function deallocates the object whose address is `ptr`; otherwise, it does nothing. You can deallocate only objects that you first allocate by calling [`calloc`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#calloc), [`malloc`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#malloc), or [`realloc`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#realloc). ## `getenv` char *getenv(const char *name);Copy to clipboard The function searches an **environment list**, which each implementation defines, for an entry whose name matches the string `name`. If the function finds a match, it returns a pointer to a static-duration object that holds the definition associated with the target environment name. Otherwise, it returns a null pointer. Do not alter the value stored in the object. If you call `getenv` again, the value stored in the object can change. No target environment names are required of all environments. ## `labs` long labs(long i);Copy to clipboard The function returns the absolute value of `i`, `|i|`, the same as [`abs`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#abs). ## `llabs` long long llabs(long long i); [added with C99]Copy to clipboard The function returns the absolute value of `i`, `|i|`, the same as [`abs`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#abs). ## `ldiv` ldiv_t ldiv(long numer, long denom);Copy to clipboard The function divides `numer` by `denom` and returns both quotient and remainder in the structure result `x`, if the quotient can be represented. The structure member `x.quot` is the algebraic quotient truncated toward zero. The structure member `x.rem` is the remainder, such that `numer == x.quot*denom + x.rem`. ## `lldiv` lldiv_t lldiv(long long numer, long long denom); [added with C99]Copy to clipboard The function divides `numer` by `denom` and returns both quotient and remainder in the structure result `x`, if the quotient can be represented. The structure member `x.quot` is the algebraic quotient truncated toward zero. The structure member `x.rem` is the remainder, such that `numer == x.quot*denom + x.rem`. ## `ldiv_t` typedef struct { long quot, rem; } ldiv_t;Copy to clipboard The type is the structure type returned by the function [`ldiv`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#ldiv). The structure contains members that represent the quotient (`quot`) and remainder (`rem`) of a signed integer division with operands of type *long.* The members shown above can occur in either order. ## `lldiv_t` typedef struct { [added with C99] long long quot, rem; } lldiv_t;Copy to clipboard The type is the structure type returned by the function [`lldiv`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#lldiv). The structure contains members that represent the quotient (`quot`) and remainder (`rem`) of a signed integer division with operands of type *long long.* The members shown above can occur in either order. ## `malloc` void *malloc(size_t size);Copy to clipboard The function allocates an object of size `size`, and returns the address of the object if successful; otherwise, it returns a null pointer. The values stored in the object are indeterminate. You can safely convert the return value to an object pointer of any type whose size is not greater than `size`. ## `MB_CUR_MAX` #define MB_CUR_MAX = 1>Copy to clipboard The macro yields the maximum number of characters that constitute a [multibyte character](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#Multibyte%20Characters) in the current [locale](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html). Its value is <= [`MB_LEN_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_limits.html#MB_LEN_MAX). ## `mblen` int mblen(const char *s, size_t n);Copy to clipboard If `s` is not a null pointer, the function returns the number of bytes in the multibyte string `s` that constitute the next multibyte character, or it returns -1 if the next `n` (or the remaining) bytes do not constitute a valid multibyte character. `mblen` does not include the terminating null in the count of bytes. The function can use a [conversion state](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#conversion%20state) stored in an internal static-duration object to determine how to interpret the multibyte string. If `s` is a null pointer and if multibyte characters have a [state-dependent encoding](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#state-dependent%20encoding) in the current [locale](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#locale), the function stores the [initial conversion state](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#initial%20conversion%20state) in its internal static-duration object and returns nonzero; otherwise, it returns zero. ## `mbstowcs` size_t mbstowcs(wchar_t *restrict wcs, const char *restrict s, size_t n);Copy to clipboard The function stores a wide character string, in successive elements of the array whose first element has the address `wcs`, by converting, in turn, each of the multibyte characters in the multibyte string `s`. The string begins in the [initial conversion state](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#initial%20conversion%20state). The function converts each character as if by calling [`mbtowc`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#mbtowc) (except that the internal conversion state stored for that function is unaffected). It stores at most `n` wide characters, stopping after it stores a null wide character. It returns the number of wide characters it stores, not counting the null wide character, if all conversions are successful; otherwise, it returns -1. ## `mbtowc` int mbtowc(wchar_t *restrict pwc, const char *restrict s, size_t n);Copy to clipboard If `s` is not a null pointer, the function determines `x`, the number of bytes in the multibyte string `s` that constitute the next multibyte character. (`x` cannot be greater than [`MB_CUR_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#MB_CUR_MAX).) If `pwc` is not a null pointer, the function converts the next multibyte character to its corresponding wide-character value and stores that value in `*pwc`. It then returns `x,` or it returns -1 if the next `n` or the remaining bytes do not constitute a valid multibyte character. `mbtowc` does not include the terminating null in the count of bytes. The function can use a [conversion state](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#conversion%20state) stored in an internal static-duration object to determine how to interpret the multibyte string. If `s` is a null pointer and if multibyte characters have a [state-dependent encoding](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#state-dependent%20encoding) in the current [locale](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#locale), the function stores the [initial conversion state](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#initial%20conversion%20state) in its internal static-duration object and returns nonzero; otherwise, it returns zero. ## `NULL` #define NULL [0 in C++]Copy to clipboard The macro yields a null pointer constant that is usable as an [address constant expression](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_express.html#address%20constant%20expression). ## `qsort` extern "C++" void qsort(void *base, size_t nelem, size_t size, int (*cmp)(const void *e1, const void *e2)); [C++ only] extern "C" [C++ only] void qsort(void *base, size_t nelem, size_t size, int (*cmp)(const void *e1, const void *e2));Copy to clipboard The function sorts, in place, an array consisting of `nelem` elements, each of `size` bytes, beginning with the element whose address is `base`. It calls the comparison function whose address is `cmp` to compare pairs of elements. The comparison function must return a negative value if `e1` is less than `e2`, zero if the two are equal, or a positive value if `e1` is greater than `e2`. Two array elements that are equal can appear in the sorted array in either order. ## `rand` int rand(void);Copy to clipboard The function computes a pseudo-random number `x` based on a seed value stored in an internal static-duration object, alters the stored seed value, and returns `x`. `x` is in the interval [0, [`RAND_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#RAND_MAX)]. ## `RAND_MAX` #define RAND_MAX = 32,767>Copy to clipboard The macro yields the maximum value returned by [`rand`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#rand). ## `realloc` void *realloc(void *ptr, size_t size);Copy to clipboard The function allocates an object of size `size`, possibly obtaining initial stored values from the object whose address is `ptr`. It returns the address of the new object if successful; otherwise, it returns a null pointer. You can safely convert the return value to an object pointer of any type whose size is not greater than `size`. If `ptr` is not a null pointer, it must be the address of an existing object that you first allocate by calling [`calloc`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#calloc), [`malloc`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#malloc), or `realloc`. If the existing object is not larger than the newly allocated object, `realloc` copies the entire existing object to the initial part of the allocated object. (The values stored in the remainder of the object are indeterminate.) Otherwise, the function copies only the initial part of the existing object that fits in the allocated object. If `realloc` succeeds in allocating a new object, it deallocates the existing object. Otherwise, the existing object is left unchanged. If `ptr` is a null pointer, the function does not store initial values in the newly created object. ## `size_t` typedef ui-type size_t;Copy to clipboard The type is the unsigned integer type `ui-type` of an object that you declare to store the result of the [*sizeof*](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_express.html#sizeof%20operator) operator. ## `srand` void srand(unsigned int seed);Copy to clipboard The function stores the seed value `seed` in a static-duration object that [`rand`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#rand) uses to compute a pseudo-random number. From a given seed value, that function always generates the same sequence of return values. The program behaves as if the target environment calls `srand(1)` at program startup. ## `strtod` double strtod(const char *restrict s, char **restrict endptr);Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *double.* If `endptr` is not a null pointer, the function stores a pointer to the unconverted remainder of the string in `*endptr`. The function then returns `x`. The initial characters of the string `s` must consist of zero or more characters for which [`isspace`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_ctype.html#isspace) returns nonzero, followed by the longest sequence of one or more characters that match any part of the full pattern for `strtod` shown in the diagram. ![](data:image/gif;base64,R0lGODdhcQLMAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampub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niRfcl9pcgoXsmVf+mYK/mQVjmNIDMVb0mZOAaZnXknnPknwXiZhhKa5TGaKRGYMmmaj2luqjlvr2k1sRlvs+mXrPmK51abBYiJt7mQbdibW+mawNma5aab7macNoOc/+x2eU6ZK3F5msNpiLyhnPGymSMSnfclmrdxgdnXi9mJndfZfS0Rk6EGiGiXjzmEm+AZE2BGEjHIXokpgTUINU2YVpehLX5GhtXSiMHnm+sJZNpJEkjIV2Jkjk2USebiOgYZWcH5ny7RniKxhWtSIYgFcl+IIWNIoRvWFWeobKvhnw76IaH4ZSAaoiYBoc5UoibanyskYpmHniBhghEBdRlBnospnSsaXAyphhAZAXEUeUuUlkhyPnsUhprUU+2xAHdUH1BCLuARRx7kHophFVkQAQuwBWh4pAUBjd+ojDlKVT8UlgepVya5jkfDFReyN8ShoPspIJIRep1wXBoTRYdxSg8Po6YFYaM3qpNf6pYmNBsZo5boI0BVgRSbJ1gfYJijNWpvE6Uf5zAeqmEyiDD55y7PpTChxaVd2qc+Q5Y3yalXQ5efCqrcQ51xSKoSRxMECZ8Biqpg+RHhOI4bdIMFqkToeJ93uRbtKJHv+Gzp6aqv2hH/GEV1BEKVsarZtKCcuGEJ+WZQwOpfHqGR1RekAFCkHvk7IglIKhJ5JKmrL5Zbz5qqHGGTsheuwUqi5vqGh5auF2Sd8uSu7Bqv8jqv9Fqv9nqv+Jqv+rqv/Nqv/vqvAJsaAQEAOw==) **Boldface** indicates a feature added with [C99](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_lib_over.html#C99). Here, `inf` is the sequence of characters `inf` or `infinity` with individual letters in either case, to represent the special value infinity. Similarly, `nan` is the sequence of characters `nan` or `nan(qualifier)` with individual letters in either case, to represent the special value not-a-number (NaN). A `qualifier` is any sequence of zero or more letters, digits, and underscores. Each implementation defines what effect, if any, a `qualifier` has on the actual encoding of a NaN. The pattern for a `strtod` hexadecimal string is shown in the diagram. ![](data:image/gif;base64,R0lGODdhcQLYAPcAAAAAAAEBAQICAgMDAwQEB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DMrg58NTSMrxB5CoHMqjvMrop8qu/MqtHMvld8e0TIGVfMu6vMu8F9zLvvzLwBzMwjzMxFzMxnzMyJzM4BIQADs=) Here, `hex` is a hexadecimal digit, in either case, and a `point` is the [decimal-point](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#decimal_point) character for the current [locale](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#locale). (It is the dot (`.`) in the [`"C"`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#C%20locale) locale.) If the string `s` matches this pattern, its equivalent value is the hexadecimal integer represented by any digits to the left of the `point`, plus the hexadecimal fraction represented by any digits to the right of the `point`, times 2 raised to the signed decimal integer power that follows an optional `p` or `P`. A leading minus sign negates the value. The pattern for a `strtod` decimal string is shown in the diagram. ![](data:image/gif;base64,R0lGODdhcQLYAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpe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LroCHLuVIHs58Luk9XkF1Lun44uqiLdae7uoWnuq7LiLAbu1PXtrRrh8t4u7q7u7wX27u++7vAG7zCO7zEW7zGe7zIm7wkExAAOw==) Here, a `point` is the [decimal-point](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#decimal_point) character for the current [locale](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#locale). (It is the dot (`.`) in the [`"C"`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#C%20locale) locale.) If the string `s` matches this pattern, its equivalent value is the decimal integer represented by any digits to the left of the `point`, plus the decimal fraction represented by any digits to the right of the `point`, times 10 raised to the signed decimal integer power that follows an optional `e` or `E`. A leading minus sign negates the value. In locales other than the [`"C"`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#C%20locale) locale, `strtod` can define additional patterns as well. If the string `s` does not match a valid pattern, the value stored in `*endptr` is `s`, and `x` is zero. If a [range error](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_math.html#range%20error) occurs, `strtod` behaves exactly as the functions declared in [``](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_math.html#<math.h>). ## `strtof` float strtof(const char *restrict s, char **restrict endptr); [added with C99]Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *float.* If `endptr` is not a null pointer, the function stores a pointer to the unconverted remainder of the string in `*endptr`. The function then returns `x`. `strtof` converts strings exactly as does [`strtod`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#strtod). If the string `s` does not match a valid pattern, the value stored in `*endptr` is `s`, and `x` is zero. If a [range error](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_math.html#range%20error) occurs, `strtod` behaves exactly as the functions declared in [``](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_math.html#<math.h>). ## `strtol` long strtol(const char *restrict s, char **restrict endptr, int base);Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *long.* If `endptr` is not a null pointer, it stores a pointer to the unconverted remainder of the string in `*endptr`. The function then returns `x`. The initial characters of the string `s` must consist of zero or more characters for which [`isspace`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_ctype.html#isspace) returns nonzero, followed by the longest sequence of one or more characters that match the pattern for `strtol` shown in the diagram. ![](data:image/gif;base64,R0lGODdhcQJsAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4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+sJFkFuB9eBLIdilsVpRTt7Wc3ecrP2O4hGU8kQoJ4NiWdF64Xegxeu/eO1w6CsspKSm+V+AKaFNY5oB+JQ1lYstpyVLQFti9faeva7LJVlN4HrhGEKN7v3mW4h37dX9OKWk9v1rnyFGl5gSmQY5sXsbO2znvwG0q+EeYqAUwXg1wj4qYK6KluzN9Z9NoRsTT3vVl/2z/p1dyr9VKuF29o68E7YKsxE4IUxLGKulNi9n/XwqoelUuCLkue9UUnh/DaYVLZec4EafPFMqabj+BbwmILqcY39Q5cw3VMh7YyrTVHsr5pWFihCVl6ZFqxhnZ5YeFihLEMgHGH9rmzDgmzxTf6ltokiBG1z0LIp8RJT+kYMzCvGVE1vPFMaxxmAC6Zz46h8Z4FllHxGPEzYvNznQkOlMax1KEQ02mVDO3rMu2ToP57pkLq1WcKPzrQ4z6yzhTYEv+KtpqZH3R+jNpH61DnRM6pXPZNPipnVpJbkq2Ed63PS+ta4zrWud83rXvv618AOtrCHTexiG/vYyE62sn0SEAA7) The function accepts the sequences `0x` or `0X` only when `base` equals zero or 16. The letters `a-z` or `A-Z` represent digits in the range [10, 36). If `base` is in the range [2, 36], the function accepts only digits with values less than `base`. If `base` == 0, then a leading `0x` or `0X` (after any sign) indicates a hexadecimal (base 16) integer, a leading `0` indicates an octal (base 8) integer, and any other valid pattern indicates a decimal (base 10) integer. If the string `s` matches this pattern, its equivalent value is the signed integer of the appropriate base represented by the digits that match the pattern. (A leading minus sign negates the value.) In locales other than the [`"C"`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#C%20locale) locale, `strtol` can define additional patterns as well. If the string `s` does not match a valid pattern, the value stored in `*endptr` is `s`, and `x` is zero. If the equivalent value is too large to represent as type *long,* `strtol` stores the value of [`ERANGE`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#ERANGE) in [`errno`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#errno) and returns either [`LONG_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_limits.html#LONG_MAX), if `x` is positive, or [`LONG_MIN`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_limits.html#LONG_MIN), if `x` is negative. ## `strtold` long double strtold(const char *restrict s, char **restrict endptr); [added with C99]Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *long double.* If `endptr` is not a null pointer, the function stores a pointer to the unconverted remainder of the string in `*endptr`. The function then returns `x`. `strtold` converts strings exactly as does [`strtod`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#strtod). If the string `s` does not match a valid pattern, the value stored in `*endptr` is `s`, and `x` is zero. If a [range error](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_math.html#range%20error) occurs, `strtod` behaves exactly as the functions declared in [``](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_math.html#<math.h>). ## `strtoll` long long strtoll(const char *restrict s, char **restrict endptr, int base); [added with C99]Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *long long.* If `endptr` is not a null pointer, it stores a pointer to the unconverted remainder of the string in `*endptr`. The function then returns `x`. `strtoll` converts strings exactly as does [`strtol`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#strtol). If the string `s` does not match a valid pattern, the value stored in `*endptr` is `s`, and `x` is zero. If the equivalent value is too large to represent as type *long long,* `strtoll` stores the value of [`ERANGE`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#ERANGE) in [`errno`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#errno) and returns either [`LLONG_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_limits.html#LLONG_MAX), if `x` is positive, or [`LLONG_MIN`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_limits.html#LLONG_MIN), if `x` is negative. ## `strtoul` unsigned long strtoul(const char *restrict s, char **restrict endptr, int base);Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *unsigned long.* If `endptr` is not a null pointer, it stores a pointer to the unconverted remainder of the string in `*endptr`. The function then returns `x`. `strtoul` converts strings exactly as does [`strtol`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#strtol), but reports a range error only if the equivalent value is too large to represent as type *unsigned long.* In this case, `strtoul` stores the value of [`ERANGE`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#ERANGE) in [`errno`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#errno) and returns [`ULONG_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_limits.html#ULONG_MAX). ## `strtoull` unsigned long long strtoull(const char *restrict s, char **restrict endptr, int base); [added with C99]Copy to clipboard The function converts the initial characters of the string `s` to an equivalent value `x` of type *unsigned long long.* If `endptr` is not a null pointer, it stores a pointer to the unconverted remainder of the string in `*endptr`. The function then returns `x`. `strtoull` converts strings exactly as does [`strtoul`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#strtoul). If the string `s` does not match a valid pattern, the value stored in `*endptr` is `s`, and `x` is zero. If the equivalent value is too large to represent as type *unsigned long long,* `strtoull` stores the value of [`ERANGE`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#ERANGE) in [`errno`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_errno.html#errno) and returns [`ULLONG_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_limits.html#ULLONG_MAX). ## `system` int system(const char *s);Copy to clipboard If `s` is not a null pointer, the function passes the string `s` to be executed by a **command processor**, supplied by the target environment, and returns the status reported by the command processor. If `s` is a null pointer, the function returns nonzero only if the target environment supplies a command processor. Each implementation defines what strings its command processor accepts. ## `wchar_t` typedef i-type wchar_t; [keyword in C++]Copy to clipboard The type is the integer type `i-type` of a [wide-character constant](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#wide-character%20constant), such as `L'X'`. You declare an object of type `wchar_t` to hold a [wide character](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#Wide-Character%20Encoding). ## `wcstombs` size_t wcstombs(char *restrict s, const wchar_t *restrict wcs, size_t n);Copy to clipboard The function stores a multibyte string, in successive elements of the array whose first element has the address `s`, by converting in turn each of the wide characters in the string `wcs`. The multibyte string begins in the [initial conversion state](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#initial%20conversion%20state). The function converts each wide character as if by calling [`wctomb`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#wctomb) (except that the [conversion state](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#conversion%20state) stored for that function is unaffected). It stores no more than `n` bytes, stopping after it stores a null byte. It returns the number of bytes it stores, not counting the null byte, if all conversions are successful; otherwise, it returns -1. ## `wctomb` int wctomb(char *s, wchar_t wchar);Copy to clipboard If `s` is not a null pointer, the function determines `x,` the number of bytes needed to represent the multibyte character corresponding to the wide character `wchar`. `x` cannot exceed [`MB_CUR_MAX`](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_stdlib.html#MB_CUR_MAX). The function converts `wchar` to its corresponding multibyte character, which it stores in successive elements of the array whose first element has the address `s`. It then returns `x,` or it returns -1 if `wchar` does not correspond to a valid multibyte character. `wctomb` includes the terminating null byte in the count of bytes. The function can use a [conversion state](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#conversion%20state) stored in a static-duration object to determine how to interpret the multibyte character string. If `s` is a null pointer and if multibyte characters have a [state-dependent encoding](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#state-dependent%20encoding) in the current [locale](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_locale.html#locale), the function stores the [initial conversion state](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_charset.html#initial%20conversion%20state) in its static-duration object and returns nonzero; otherwise, it returns zero. * * * See also the **[Table of Contents](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_index.html#Table%20of%20Contents)** and the **[Index](https://docs.qualcomm.com/doc/80-N3040-23/topic/_c_index.html)**. *[Copyright](https://docs.qualcomm.com/doc/80-N3040-23/topic/c_crit_pjp.html) © 1992-2006by P.J. Plauger and Jim Brodie. All rights reserved.* Last Published: Oct 06, 2026 Previous Topic Next Topic