-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_swap.c
More file actions
27 lines (24 loc) · 1.07 KB
/
ft_swap.c
File metadata and controls
27 lines (24 loc) · 1.07 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ophuong <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/08/07 11:36:04 by ophuong #+# #+# */
/* Updated: 2020/02/26 10:48:05 by ophuong ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_swap(void *a, void *b, size_t size)
{
char swap;
size_t i;
i = -1;
while (++i < size)
{
swap = ((char*)a)[i];
((char*)a)[i] = ((char*)b)[i];
((char*)b)[i] = swap;
}
}