-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_swap.c
40 lines (33 loc) · 1.14 KB
/
ft_swap.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: malexand <malexand@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/07/10 11:04:42 by malexand #+# #+# */
/* Updated: 2017/02/16 17:34:27 by malexand ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_swap(size_t *a, size_t *b)
{
size_t nbr;
nbr = *a;
*a = *b;
*b = nbr;
}
void ft_swap_int(int *a, int *b)
{
int nbr;
nbr = *a;
*a = *b;
*b = nbr;
}
void ft_swap_char(char *a, char *b)
{
char nbr;
nbr = *a;
*a = *b;
*b = nbr;
}