Everything
7.5.8 General utility functions

General utility functions are as follows.

Table 7.10

General Utility Functions

Function/Macro Name

Outline

atof

Conversion of character string to floating-point number (double type)

atoff

Conversion of character string to floating-point number (float type)

atoi

Conversion of character string to integer (int type)

atol

Conversion of character string to integer (long int type)

atoll [V1.07 or later]

Conversion of character string to integer (long long int type) (C99)

strtod

Conversion of character string to floating-point number (double type) (storing pointer to last character string

strtof

Conversion of character string to floating-point number (float type) (storing pointer to last character string

strtold [V1.07 or later]

Conversion of character string to floating-point number (long double type) (storing pointer to last character string) (C99)

strtol

Conversion of character string to integer (long int type) and storing pointer to last character string

strtoll [V1.07 or later]

Conversion of character string to integer (long long int type) and storing pointer to last character string (C99)

strtoul

Conversion of character string to integer (unsigned long int type) and storing pointer to last character string

strtoull [V1.07 or later]

Conversion of character string to integer (unsigned long long int type) and storing pointer to last character string (C99)

rand

Pseudorandom number sequence generation

srand

Setting of type of pseudorandom number sequence

calloc [V1.02 or later]

Allocates dynamic memory that is initialized by 0.

free [V1.02 or later]

Releases dynamic memory

malloc [V1.02 or later]

Allocates dynamic memory

realloc [V1.02 or later]

Re-allocates dynamic memory

abort

Terminates the program

bsearch

Binary search

qsort

Sort

abs

Output absolute value (int type)

div

Division (int type)

labs

Output absolute value (long type)

ldiv

Division (long type)

llabs [V1.07 or later]

Output absolute value (long long type) (C99)

lldiv [V1.07 or later]

Division (long long type) (C99)