-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathft_memset.c
29 lines (25 loc) · 1.07 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jaeskim <jaeskim@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/09/24 20:19:37 by jaeskim #+# #+# */
/* Updated: 2020/09/25 21:30:11 by jaeskim ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** ft_memset - fill memory with a constant byte
*/
void *ft_memset(void *s, int c, size_t n)
{
unsigned char *ptr;
ptr = s;
while (n-- > 0)
{
*ptr++ = c;
}
return (s);
}