Book
Collection
Click for Table of Contents
© 2025 by Rance D. Necaise
C Primer for Python Programmers
Copyright © 2025
Rance D. Necaise

D.3 The stdlib.h Module

#include <ctype.h>

The standard general utilities library that defines general purpose functions for dynamic memory management, random number generation, searching, sorting, and string conversions.

Functions

String Conversion Functions
double atof(const char* str);
int atoi(const char* str);
long atol(const char* str);
Pseudo-Random Number Functions
int rand(void);
void srand(unsigned int seed);
Dynamic Memory Functions
void * malloc(int size);
void * calloc(int num, int size);
void free(void *ptr);
Program Execution Functions
void exit(int status);
void abort(void);
Searching and Sorting Functions
Integer Math Functions
int abs(int x);

Detailed Description

double atof(const char* str);
Parameters:
str
The string to be converted to a floating-point value.
int atoi(const char* str);
Parameters:
str
The string to be converted to an integer value.
long atol(const char* str);
Parameters:
str
The string to be converted to a long integer value.
int rand(void);
void srand(unsigned int seed);
Parameters:
seed
void * malloc(int size);
Parameters:
size
void * calloc(int num, int size);
Parameters:
num
size
void free(void *ptr);
Parameters:
ptr
void exit(int status);
Parameters:
status
void abort(void);
int abs(int x);
Parameters:
x