C Header Files
All library function inside of stdlib.h in C
stdlib.h is another header file in C. There are some built in function which is defined inside this header file and in this article we will see some of them. Here are some of the library function of stdlib.h header file in C.
- malloc() — malloc() is defined under the stdlib.h which is used to allocate memory dynamically. This function can allocate memory during runtime of the program.
- calloc() — calloc() is also used for dynamic memory allocation which is defined in stdlib.h header file.
- realloc() — realloc() function can reallocate the memory space taken by malloc() or calloc() during the runtime of progrm.
- free() — free() function frees the memory allocated by malloc() or calloc() function.
- delay() — delay() function suspends the program from being execute for a particular time.
- abs() — abs() function gives the absolute value of any integer.
- div() — div() function is used to perform division operation and it is defined inside the stdlib.h header file.
- exit() — exit() function terminates the program without returning any value.
- abort() — abort() function is also defined inside this header file and is used to terminate the C program.
- system() — system() is used to execute the command outside the C program.
- rand() — rand() function is used to create random integer number.
- atoi() — atoi() function is used to convert a string to integer.
- atol() — atol() function converts the string to long.
- atof() — This function is defined inside stdlib.h which is use to convert string to float.
- atrtod() — This function can convert string to double type data.
- strtol() — strtol() library function is used to convert string to long.