-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_chartostr.c
25 lines (22 loc) · 1.05 KB
/
ft_chartostr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_chartostr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wbertoni <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/27 18:18:00 by wbertoni #+# #+# */
/* Updated: 2020/02/04 12:50:21 by wbertoni ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_chartostr(char c)
{
char *str;
str = (char *)malloc(2 * sizeof(char));
if (str == NULL)
return (NULL);
str[0] = c;
str[1] = '\0';
return (str);
}