You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.1 KiB
26 lines
1.1 KiB
2 years ago
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* tools.cpp :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/11/02 11:01:55 by narnaud #+# #+# */
|
||
|
/* Updated: 2022/11/02 11:14:36 by narnaud ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include <stddef.h>
|
||
|
|
||
|
void *ft_memset(void *b, int c, size_t len)
|
||
|
{
|
||
|
size_t i;
|
||
|
unsigned char * b_cpy;
|
||
|
|
||
|
b_cpy = (unsigned char *)b;
|
||
|
i = 0;
|
||
|
while (i < len)
|
||
|
*(unsigned char *)(b_cpy + i++) = (unsigned char)c;
|
||
|
return ((void *)b);
|
||
|
}
|