Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void *ft_memset(void *str, int value, unsigned int length)
- {
- char *string;
- unsigned char char_value;
- char_value = value + '0';
- string = str;
- while (--length)
- {
- *string = char_value;
- ++string;
- }
- return (str);
- }
- // gcc's original memset:
- void *memset(void *dst, int c, size_t n)
- {
- if (n) {
- char *d = dst;
- do {
- *d++ = c;
- } while (--n);
- }
- return dst;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement