2023-03-28 09:55:08 -04:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* 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 */
|
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
2023-02-14 01:08:25 -05:00
|
|
|
#include "extra.h"
|
2023-02-09 12:47:05 -05:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|