-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memset.c
More file actions
33 lines (29 loc) · 1.22 KB
/
ft_memset.c
File metadata and controls
33 lines (29 loc) · 1.22 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kmoutaou <marvin@.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/04 13:36:02 by kmoutaou #+# #+# */
/* Updated: 2021/11/22 09:44:07 by kmoutaou ### ########.fr */
/* */
/* ************************************************************************** */
/*
ft_memset is a re-coded -memset- function that copies the -unsigned characted-
c to the first n characters of the string pointed to by str.
*/
#include "libft.h"
void *ft_memset(void *str, int c, size_t n)
{
unsigned char *str1;
unsigned int i;
str1 = (unsigned char *)str;
i = 0;
while (i < n)
{
str1[i] = c;
i++;
}
return (str);
}