-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memset.c
More file actions
43 lines (38 loc) · 1.29 KB
/
ft_memset.c
File metadata and controls
43 lines (38 loc) · 1.29 KB
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
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dhuss <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/11 10:41:50 by dhuss #+# #+# */
/* Updated: 2024/03/11 10:55:51 by dhuss ### ########.fr */
/* */
/* ************************************************************************** */
/* #include <stdio.h>
#include <string.h> */
#include "libft.h"
void *ft_memset(void *b, int c, size_t len)
{
unsigned char *ptr;
size_t i;
i = 0;
ptr = (unsigned char *)b;
while (i < len)
{
ptr[i] = c;
i++;
}
return (ptr);
}
/* int main(void)
{
char b[] = "PlsBMemsetMe";
int c;
size_t len;
c = 'a';
len = 3;
printf("%s\n", ft_memset(b, c, len));
printf("%s\n", memset(b, c, len));
return (0);
} */