-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memset.c
28 lines (25 loc) · 1.1 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: figarcia <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/28 12:38:55 by figarcia #+# #+# */
/* Updated: 2024/10/21 18:43:12 by figarcia ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *ptr, int value, size_t num_bytes)
{
unsigned char *p;
size_t i;
p = (unsigned char *)ptr;
i = 0;
while (i < num_bytes)
{
p[i] = (unsigned char)value;
i++;
}
return (ptr);
}