Parameters
- ptr
- Pointer to the block of memory to fill.
- value
- Value to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value.
- num
- Number of bytes to be set to the value.
Return Value
ptr is returned.Example
| 1 2 3 4 5 6 7 8 9 10 11 |
|
Output:
------ every programmer should know memset! |
See also
| memcpy | Copy block of memory (function) |
| strncpy | Copy characters from string (function) |
| memcmp | Compare two blocks of memory (function) |
