42_cube3D/libftx/extra/ft_swap.c
Camille Chauvet 537283e940 add: libftx
2023-04-26 11:02:44 +00:00

41 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/27 13:43:25 by cchauvet #+# #+# */
/* Updated: 2023/03/27 13:43:26 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "extra.h"
void ft_swap(void *a, void *b)
{
void *c;
c = a;
a = b;
b = c;
}
void ft_swap_char(char *a, char *b)
{
char c;
c = *a;
*a = *b;
*b = c;
}
void ft_swap_int(int *a, int *b)
{
int c;
c = *a;
*a = *b;
*b = c;
}