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

Functions

static size_t get_base_len (const char *base)
 Calculates the length of a base string.
 
static size_t get_res_len (unsigned long n, size_t base_len)
 Calculates the result string length for a number in a given base.
 
char * ft_ultoa_base (unsigned long n, const char *base)
 Converts an unsigned long to a string in a given base.
 

Function Documentation

◆ get_base_len()

static size_t get_base_len ( const char *  base)
static

Calculates the length of a base string.

Parameters
baseBase string.
Returns
Length of the base.
Here is the caller graph for this function:

◆ get_res_len()

static size_t get_res_len ( unsigned long  n,
size_t  base_len 
)
static

Calculates the result string length for a number in a given base.

Parameters
nNumber to convert.
base_lenLength of the base.
Returns
Required string length.
Here is the caller graph for this function: