migrate from https://cmakerhk.wordpress.com/2018/09/28/memset/
void *memset(void *str, int c, size_t n)
memset use set the value be c at pointer str n times and return pointer str
str is a void pointer, so that you can pass in any type.
#include #include int main () { char str[50]; strcpy(str,"Hello World"); puts(str); memset(str,'$',2); puts(str); return(0); }
Hello World $$llo World
memset(str, 0, sizeof(str)); //Empty str