-
Notifications
You must be signed in to change notification settings - Fork 0
/
gg.c
executable file
·64 lines (54 loc) · 908 Bytes
/
gg.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <unistd.h>
#include <stdlib.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
/*
void ft_putstr(*str)
{
char *pnt;
*pnt = *str;
while(*str++)
ft_putchar(*pnt++);
}
*/
void ft_putnum(int num)
{
while (num)
{
ft_putchar((num % 10) + '0');
num -= (num % 10);
num /= 10;
}
}
int ft_str_cnt_put(char *c)
{
int strlen;
strlen = -1;
ft_putchar(*c);
while (*c++)
{
ft_putchar(*c);
strlen++;
}
ft_putchar(':');
ft_putchar('\t');
return ++strlen;
}
int main(int argc, char **argv)
{
char *str;
int i;
i = 1;
//char string1[6] = "hello\0";
while(argv[i])
{
ft_putnum(ft_str_cnt_put(argv[i++]));
ft_putchar('\n');
}
//string1[6] = '\0'; -> FUCK NO!! -> Save lines save lives...
//char *str;
//str = string1;
return 0;
}