-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memset.c
34 lines (30 loc) · 1.21 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: alexmitcul <alexmitcul@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/17 12:49:33 by alexmitcul #+# #+# */
/* Updated: 2022/11/06 21:56:45 by alexmitcul ### ########.fr */
/* */
/* ************************************************************************** */
/**
* - The memset() function writes len bytes of value c
* (converted to an unsigned char) to the string b.
*
* - The memset() function returns its first argument.
**/
#include "libft.h"
void *ft_memset(void *b, int c, size_t len)
{
void *tmp;
tmp = b;
while (len > 0)
{
*(char *)tmp = c;
tmp++;
len -= 1;
}
return (b);
}