void* memset(void *dest, int val, int n)
Returns a pointer to the destination (dest) memory block.
memset sets each byte in the memory block to the given value/character, up to the number of bytes given.
%fml OnFilterStart: { // Allocate 1000 bytes of memory char* strbuffer; strbuffer = malloc(1000); // Fill the memory block with zeros memset(strbuffer, 0, 1000); // Set short lengths to a letter, // progressively overwriting them memset(strbuffer, 'e', 10); memset(strbuffer, 'D', 8); memset(strbuffer, 'c', 6); memset(strbuffer, 'B', 4); memset(strbuffer, 'a', 2); // Prints 'aaBBccDDee' printf("%s", strbuffer); // Release the memory again free(strbuffer); return true; }