init
This commit is contained in:
21
Test/c02/ex00/main.c
Normal file
21
Test/c02/ex00/main.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <unistd.h>
|
||||
|
||||
char *ft_strcpy(char *dest, char *src);
|
||||
|
||||
void ft_print(char *str)
|
||||
{
|
||||
while(*str != 0)
|
||||
{
|
||||
write(1, str++, 1);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char *a;
|
||||
char b[5];
|
||||
|
||||
a = "00000";
|
||||
ft_strncpy(b, a);
|
||||
ft_print(b);
|
||||
}
|
22
Test/c02/ex01/main.c
Normal file
22
Test/c02/ex01/main.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <unistd.h>
|
||||
|
||||
char *ft_strncpy(char *dest, char *src, unsigned int n);
|
||||
|
||||
void ft_print(char *str)
|
||||
{
|
||||
while(*str != 0)
|
||||
{
|
||||
write(1, str++, 1);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char *a;
|
||||
char b[6];
|
||||
|
||||
b[5] = 'd';
|
||||
a = "00000";
|
||||
ft_strncpy(b, a, 5);
|
||||
ft_print(b);
|
||||
}
|
17
Test/c02/ex02/main.c
Normal file
17
Test/c02/ex02/main.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int ft_str_is_alpha(char *str);
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ft_putchar(ft_str_is_alpha("ff")+'0');
|
||||
ft_putchar(ft_str_is_alpha("dfdf5f")+'0');
|
||||
ft_putchar(ft_str_is_alpha("GDGFSGF")+48);
|
||||
ft_putchar(ft_str_is_alpha("FG5DG")+48);
|
||||
ft_putchar(ft_str_is_alpha("")+48);
|
||||
}
|
17
Test/c02/ex03/main.c
Normal file
17
Test/c02/ex03/main.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int ft_str_is_numeric(char *str);
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ft_putchar(ft_str_is_numeric("55654")+48);
|
||||
ft_putchar(ft_str_is_numeric("ssdf5")+48);
|
||||
ft_putchar(ft_str_is_numeric("5")+48);
|
||||
ft_putchar(ft_str_is_numeric("55d654")+48);
|
||||
ft_putchar(ft_str_is_numeric("")+48);
|
||||
}
|
17
Test/c02/ex04/main.c
Normal file
17
Test/c02/ex04/main.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int ft_str_is_lowercase(char *str);
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ft_putchar(ft_str_is_lowercase("ff")+'0');
|
||||
ft_putchar(ft_str_is_lowercase("dfdf5f")+'0');
|
||||
ft_putchar(ft_str_is_lowercase("d")+48);
|
||||
ft_putchar(ft_str_is_lowercase("FG5DG")+48);
|
||||
ft_putchar(ft_str_is_lowercase("")+48);
|
||||
}
|
18
Test/c02/ex05/main.c
Normal file
18
Test/c02/ex05/main.c
Normal file
@ -0,0 +1,18 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int ft_str_is_uppercase(char *str);
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ft_putchar(ft_str_is_uppercase("AAA")+'0');
|
||||
ft_putchar(ft_str_is_uppercase("dfdf5f")+'0');
|
||||
ft_putchar(ft_str_is_uppercase("Z")+48);
|
||||
ft_putchar(ft_str_is_uppercase("FG5DG")+48);
|
||||
ft_putchar(ft_str_is_uppercase("")+48);
|
||||
}
|
||||
|
17
Test/c02/ex06/main.c
Normal file
17
Test/c02/ex06/main.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int ft_str_is_printable(char *str);
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ft_putchar(ft_str_is_printable(" ")+48);
|
||||
ft_putchar(ft_str_is_printable("\n")+48);
|
||||
ft_putchar(ft_str_is_printable("~")+48);
|
||||
ft_putchar(ft_str_is_printable("\b")+48);
|
||||
ft_putchar(ft_str_is_printable("")+48);
|
||||
}
|
25
Test/c02/ex07/main.c
Normal file
25
Test/c02/ex07/main.c
Normal file
@ -0,0 +1,25 @@
|
||||
#include <unistd.h>
|
||||
|
||||
char *ft_strupcase(char *str);
|
||||
|
||||
void ft_print(char *str)
|
||||
{
|
||||
while (*str != 0)
|
||||
write(1, str++, 1);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char a[4] = "test";
|
||||
ft_print(ft_strupcase(a));
|
||||
|
||||
char b[4] = "TEST";
|
||||
ft_print(ft_strupcase(b));
|
||||
|
||||
char c[4] = "t3st";
|
||||
ft_print(ft_strupcase(c));
|
||||
|
||||
char d[4] = "t3St";
|
||||
ft_print(ft_strupcase(d));
|
||||
|
||||
}
|
Reference in New Issue
Block a user