26 lines
1.0 KiB
C
26 lines
1.0 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_ctoa.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/10/05 21:42:53 by cchauvet #+# #+# */
|
||
|
/* Updated: 2022/10/07 00:49:07 by cchauvet ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "libftprintf.h"
|
||
|
|
||
|
char *ft_ctoa(int c)
|
||
|
{
|
||
|
char *s;
|
||
|
|
||
|
s = malloc(sizeof(char) * 2);
|
||
|
if (s == NULL)
|
||
|
return (NULL);
|
||
|
s[0] = (char) c;
|
||
|
s[1] = 0;
|
||
|
return (s);
|
||
|
}
|