-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
39 lines (33 loc) · 1.16 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
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: evdos-sa <evdos-sa@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/02 12:56:27 by evdos-sa #+# #+# */
/* Updated: 2022/11/18 20:43:40 by evdos-sa ### ########.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] = c;
i++;
}
return (s);
}
/*
int main () {
char str[50];
strcpy(str,"Everton");
puts(str);
ft_memset(str,'7', 4);
puts(str);
return(0);
}
*/