ft_itoa_base - kibotrel/42-Libft GitHub Wiki

char	*ft_itoa_base(int value, int base)

Description :

Converts an integer n expressed in base base between 2 and 16 into a string.

Return Value :

Returns the string equivalent of the given integer, in a new allocated string. If the given value is expressed in base = 10, both positive and negatives values can be computed in the other hand, if base != 10, only positive values can be processed, in this case, if value < 0, the opposite of value will be used. Finally if base < 2 or base > 16 NULL is returned.

Source code