Libft
42 Libft library documentation
Loading...
Searching...
No Matches
ft_memset.c File Reference
#include <stdlib.h>
+ Include dependency graph for ft_memset.c:

Go to the source code of this file.

Functions

void * ft_memset (void *s, int c, size_t len)
 Fills a memory area with a byte value.
 

Function Documentation

◆ ft_memset()

void * ft_memset ( void *  s,
int  c,
size_t  len 
)

Fills a memory area with a byte value.

Parameters
sPointer to the memory area.
cByte value used for filling.
lenNumber of bytes to set.
Returns
Original s pointer.

Definition at line 23 of file ft_memset.c.

24{
25 unsigned char *ptr;
26
27 ptr = (unsigned char *)s;
28 while (len--)
29 *ptr++ = (unsigned char)c;
30 return (s);
31}

Referenced by ft_bzero(), and ft_calloc().

+ Here is the caller graph for this function: