first commit
This commit is contained in:
6
ended/C01/ex00/ft_ft.c
Normal file
6
ended/C01/ex00/ft_ft.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void ft_ft(int *nbr)
|
||||
{
|
||||
*nbr = 42;
|
||||
}
|
6
ended/C01/ex01/ft_ultimate_ft.c
Normal file
6
ended/C01/ex01/ft_ultimate_ft.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void ft_ultimate_ft(int *********nbr)
|
||||
{
|
||||
*********nbr = 42;
|
||||
}
|
10
ended/C01/ex02/ft_swap.c
Normal file
10
ended/C01/ex02/ft_swap.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void ft_swap(int *a, int *b)
|
||||
{
|
||||
int f;
|
||||
|
||||
f = *a;
|
||||
*a = *b;
|
||||
*b = f;
|
||||
}
|
7
ended/C01/ex03/ft_div_mod.c
Normal file
7
ended/C01/ex03/ft_div_mod.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void ft_div_mod(int a, int b, int *div, int *mod)
|
||||
{
|
||||
*div = a / b;
|
||||
*mod = a % b;
|
||||
}
|
12
ended/C01/ex04/ft_ultimate_div_mod.c
Normal file
12
ended/C01/ex04/ft_ultimate_div_mod.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void ft_ultimate_div_mod(int *a, int *b)
|
||||
{
|
||||
int f;
|
||||
int g;
|
||||
|
||||
f = *a;
|
||||
g = *b;
|
||||
*a = f / g;
|
||||
*b = f % g;
|
||||
}
|
13
ended/C01/ex05/ft_putstr.c
Normal file
13
ended/C01/ex05/ft_putstr.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_putstr(char *str)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (str[i])
|
||||
{
|
||||
write(1, &str[i], 1);
|
||||
i++;
|
||||
}
|
||||
}
|
11
ended/C01/ex06/ft_strlen.c
Normal file
11
ended/C01/ex06/ft_strlen.c
Normal file
@ -0,0 +1,11 @@
|
||||
int ft_strlen(char *str)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (str[i] != '\0')
|
||||
{
|
||||
i++;
|
||||
}
|
||||
return (i);
|
||||
}
|
Reference in New Issue
Block a user