-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_echo.c
31 lines (28 loc) · 1.22 KB
/
ft_echo.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
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_echo.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edelangh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/04/27 16:13:15 by edelangh #+# #+# */
/* Updated: 2015/04/27 16:40:59 by edelangh ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include "ft_printf.h"
int ft_echo(void **a, int size)
{
int d;
char c;
a = *a;
c = (char)(long)a;
d = (int)(long)a;
if (size == sizeof(char))
ft_printf("(%d):(%c)\n", c, c);
if (size == sizeof(short) || size == sizeof(int))
ft_printf("(%d)\n", d);
if (size == sizeof(void*))
ft_printf("(%s)\n", d);
return (size);
}