No null-character is implicitly appended to the end of destination, so destination will only be null-terminated if the length of the C string in source is less than num.
Parameters
- destination
- Pointer to the destination array where the content is to be copied.
- source
- C string to be copied.
- num
- Maximum number of characters to be copied from source.
Return Value
destination is returned.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Output:
To be |
See also
| strcpy | Copy string (function) |
| memcpy | Copy block of memory (function) |
| memmove | Move block of memory (function) |
| memchr | Locate character in block of memory (function) |
| memcmp | Compare two blocks of memory (function) |
| memset | Fill block of memory (function) |
