42_ft_printf/ft_ctoa.c
Camille Chauvet af946dbf97 v1
2022-10-10 19:33:47 +02:00

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/10 14:41:19 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "printf.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);
}