In C++, the <cstdlib> header provides functions for memory allocation

In C++, the <cstdlib> header provides functions for memory allocation, type conversion, random number generation, and process control. It includes functions inherited from C, such as malloc(), free(), atoi(), rand(), and exit().

Example Uses of <cstdlib>
cpp
Copy
Edit
#include <iostream>
#include <cstdlib> // Required for C-style functions

int main() {
// Convert string to integer
int num = atoi("123");
std::cout << "Converted number: " << num << std::endl;