A great C function which will fill a specified range of memory with specified data. For instance if you want to erase data, you can set all the data to zeros. As far as I know, it is located in string.h.

Syntax:
memset(destination, value, copies);
The destination is the pointer to the beginning of memory you want to fill with data. Value is the data you want to fill it with, and lastly the number of copies] specified is how many times value will be copied into memory. Here is an example of how to use memset, this code will fill a character array string with 10 uppercase letter 'S':
char myString[11];
memset(myString, 'S', 10);
memset(myString+10, '\0', 1);
It's a little silly to use memset to set one byte (in this case, the null terminator at the end of the string) but this code is simply proof of concept, just an example for the purpose of explanation.

Log in or registerto write something here or to contact authors.