The libc standard utilites header
Martin ‘Solar’ Baute
Public Domain
abort abs atexit atoi atol atoll bsearch calloc div exit free labs ldiv llabs lldiv malloc qsort rand realloc srand strtol strtoll strtoul strtoull _Exit
-lc
stdlib.h | The libc standard utilites header |
Todo’s | |
atof(), strtof(), strtod(), strtold() | |
Constants | |
RAND_MAX | defines the maxinum number returned by rand |
Todo’s | |
Macro MB_CUR_MAX |
defines the maxinum number returned by rand
Returns a random number between 0 and RAND_MAX
int rand( void )
Raises the abort signal
void abort( void )
Returns the absolute value of a given integer
int abs( int j )
adds a function to the list of things to be called upon program exit
int atexit( void (*func)( void ) )
Converts a string to an int
int atoi( const char * s )
Converts a string to a long int
long int atol( const char * s )
Converts a string to a long long
long long int atoll( const char * s )
Performs a binary search inside an array of nmemb itens of size bytes
void * bsearch( const void * key, const void * base, size_t nmemb, size_t size, int (*compar)( const void *, const void * ) )
Allocates nmemb consecutive blocks of size bytes, and zeroes the memory
void * calloc( size_t nmemb, size_t size )
Performs a division on integers both the quotient and remainder are stored in a div_t (_PDCLIB_div_t) struct
div_t div( int numer, int denom )
exits the program with a given status code
void exit( int status )
Deallocates a block of memory created by malloc calloc or realloc.
void free( void * ptr )
Returns the absolute value of a given long int
long int labs( long int j )
Performs a division on long ints both the quotient and remainder are stored in a ldiv_t (_PDCLIB_ldiv_t) struct
ldiv_t ldiv( long int numer, long int denom )
Returns the absolute value of a given long long
long long int llabs( long long int j )
Performs a division on long longs both the quotient and remainder are stored in a lldiv_t (_PDCLIB_lldiv_t) struct
lldiv_t lldiv( long long int numer, long long int denom )
Allocates size bytes of memory
void * malloc( size_t size )
Sorts an array in memory
void qsort( void * base, size_t nmemb, size_t size, int (*compar)( const void *, const void * ) )
Attempts to resize the allocated block of memory given in ptr.
void * realloc( void * ptr, size_t size )
Sets the new seed to be used by rand
void srand( unsigned int seed )
Converts a string in s to an long.
long int strtol( const char * s, char ** endptr, int base )
Converts a string in s to an long long.
long long int strtoll( const char * s, char ** endptr, int base )
Converts a string in s to an unsigned long.
unsigned long int strtoul( const char * s, char ** endptr, int base )
Converts a string in s to an unsigned long long.
unsigned long long int strtoull( const char * s, char ** endptr, int base )
exits the program with a given status code, without running atexit scripts
void _Exit( int status )