-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
34 lines (29 loc) · 1.14 KB
/
ft_memset.c
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
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ldel-val <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/16 17:15:34 by ldel-val #+# #+# */
/* Updated: 2024/10/10 19:46:50 by ldel-val ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *s, int c, size_t n)
{
size_t i;
i = 0;
while (i < n)
{
((unsigned char *)s)[i] = (unsigned char)c;
i++;
}
return (s);
}
/*
int main(void)
{
char test[] = "hola mundo";
printf("%s", (char *)ft_memset(test, 'r', 5));
}*/