-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathft_memset.c
More file actions
40 lines (36 loc) · 1.41 KB
/
Copy pathft_memset.c
File metadata and controls
40 lines (36 loc) · 1.41 KB
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
35
36
37
38
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cado-car <cado-car@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/07/30 20:23:13 by cado-car #+# #+# */
/* Updated: 2021/07/30 20:23:13 by cado-car ### ########lyon.fr */
/* */
/* ************************************************************************** */
/*
* LIBRARY
* #include <string.h>
* DESCRIPTION
* The memset() function writes len bytes of value c (converted to an
* unsigned char) to the string b.
* PARAMETERS
* #1. The destiny pointer in which to write.
* #2. The character to write.
* #3. The number of bytes to write.
* RETURN VALUES
* The memset() function returns its first argument.
*/
#include "libft.h"
void *ft_memset(void *s, int c, size_t n)
{
size_t i;
i = 0;
while (i < n)
{
((unsigned char *)s)[i] = c;
i++;
}
return (s);
}