Libft
Custom implementation of core libc functions with additional utility helpers.
Loading...
Searching...
No Matches
ft_zutoa.c File Reference
#include <stdlib.h>
Include dependency graph for ft_zutoa.c:

Functions

static size_t get_len (size_t n)
 Calculates the string length needed for a size_t number.
 
static void populate (size_t n, char *str, size_t i)
 Recursively populates a string with digits from a size_t.
 
char * ft_zutoa (size_t n)
 Converts a size_t to a string.
 

Function Documentation

◆ get_len()

static size_t get_len ( size_t  n)
static

Calculates the string length needed for a size_t number.

Parameters
nSize_t number.
Returns
Length of the decimal representation.
Here is the caller graph for this function:

◆ populate()

static void populate ( size_t  n,
char *  str,
size_t  i 
)
static

Recursively populates a string with digits from a size_t.

Parameters
nSize_t number to convert.
strDestination string.
iCurrent index to write to.
Here is the call graph for this function:
Here is the caller graph for this function: