-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memset.c
More file actions
40 lines (35 loc) · 1.23 KB
/
ft_memset.c
File metadata and controls
40 lines (35 loc) · 1.23 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: lcosta-g <lcosta-g@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/09 13:14:17 by lcosta-g #+# #+# */
/* Updated: 2024/10/15 17:41:39 by lcosta-g ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memset(void *s, int c, size_t n)
{
size_t i;
unsigned char *temp;
i = 0;
temp = (unsigned char *)s;
while (i < n)
temp[i++] = (unsigned char)c;
return (s);
}
/*
#include <stdio.h>
int main(void)
{
int mem[12];
int i;
ft_memset(mem, 5, 3 * sizeof(int));
i = 0;
while (i < 3)
printf("%i\n", mem[i++]);
return (0);
}
*/