strcpy() / strcat()
Copies / concatenates text.
Syntax
strcpy(dest, src)
Description
In C, text cannot be copied with =. strcpy copies, strcat appends to the end. The target array must be large enough.
Example
Loading editor…
Expected output
HexLibrary
When to use?
Creating/joining text.
Common mistakes
- ⚠️ You cannot copy text with =; use strcpy.
- ⚠️ If the target array overflows, it causes a memory error.