-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memset.c
More file actions
37 lines (34 loc) · 1.21 KB
/
Copy pathft_memset.c
File metadata and controls
37 lines (34 loc) · 1.21 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dpadenko <dpadenko@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/05 16:23:43 by dpadenko #+# #+# */
/* Updated: 2023/09/15 22:10:17 by dpadenko ### ########.fr */
/* */
/* ************************************************************************** */
//#include <strings.h>
#include "libft.h"
void *ft_memset(void *ptr, int value, size_t n)
{
unsigned int i;
i = n;
while (n)
{
*(char *)ptr = value;
ptr++;
n = n - 1;
}
return (ptr - i);
}
/*
#include <stdio.h>
int main(void)
{
char str[] = "occupied memory";
ft_memset(str, 33, 5);
printf("modifided memory: %s\n", str);
}
*/