42_minishell/libftx/extra/ft_swap.c
2023-03-28 15:55:08 +02: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;
}