Copy one character array to another.
Compatibility:This function is compatible with the following targets:
|
|
#include <string.h>
char *strcpy(char *dest, const char *source);Parameters:
Parameters for this facility are:
If the arrays pointed to by dest and source overlap, the operation of strcpy() is undefined.
strcpy() returns the value of dest.
#include <string.h>
#include <stdio.h>
int main(void)
{
char d[30] = "";
static char s[] = "Metrowerks";
printf(" s=%s\n d=%s\n", s, d);
strcpy(d, s);
printf(" s=%s\n d=%s\n", s, d);
return 0;
}
Output:
s=Metrowerks
d=
s=Metrowerks
d=Metrowerks
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000