Libft
42 Libft library documentation
Loading...
Searching...
No Matches
ft_memset.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_memset.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: raphalme <raphalme@student.42.fr> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/12/29 18:40:00 by raphalme #+# #+# */
9/* Updated: 2026/04/14 10:45:22 by raphalme ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#include <stdlib.h>
14
23void *ft_memset(void *s, int c, size_t len)
24{
25 unsigned char *ptr;
26
27 ptr = (unsigned char *)s;
28 while (len--)
29 *ptr++ = (unsigned char)c;
30 return (s);
31}
void * ft_memset(void *s, int c, size_t len)
Fills a memory area with a byte value.
Definition ft_memset.c:23