-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memset.c
30 lines (26 loc) · 1.19 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bnidia <bnidia@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/09 05:02:16 by bnidia #+# #+# */
/* Updated: 2021/10/29 02:56:34 by bnidia ### ########.fr */
/* */
/* ************************************************************************** */
/* ft_memset
** Fill with "len" bytes of "c" the memory of "dest".
** Пример: ("123456", '!', 2) получим "!!3456"
** Return Value
** A pointer to the memory area dest
*/
#include "libft.h"
void *ft_memset(void *dest, int c, size_t len)
{
char *d;
d = (char *)dest;
while (len--)
*d++ = c;
return (dest);
}