strcpy
raw OCR
Copies one string into another.
Defined in header <string.h>
Syntax
#include <string.h>
char *strcpy(char *dest, const char *src);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ | ■ | ■ |
Remarks
Copies string src to dest, stopping after the terminating null character has been moved.
Return value
strcpy returns dest.
See also
Example
#include <stdio.h>
#include <string.h>
int main (void)
{
char string [10];
char *strl = "abcdefghi";
strcpy (string, strl);
printf ("%s\n", string);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/string.h/strcpy/
· short form /3.1/strcpy/