create my own memset function in c
here is the prototype: void *memset(void *s, int c, size_t n) first im not sure if I have to return something because when I use the memset i do for example memset(str, 'a', 5); instead of str = memset(str, 'a', 5); here is where I am with my code: void *my_memset(void *b, int c, int len) { int i; i = 0; while(b && len > 0) { b = c; b++; len--; } return(b); } int main() { char *str; str = strdup("hello"); my_memset(str, 'a', 5); printf("%s\n", str); } I dont want to use array in this function, to better understand pointer and memory, so I dont get 2 things: - how to copy the int c into a