using the strcpy function
#include <stdio.h>
#include <string.h>
#define iSIZE 20
main( )
{
char s[iSIZE]="Initialized String!",d[iSIZE];
strcpy(d,"String Constant");
printf("%s\n",d);
strcpy(d,s);
printf("%s\n",d);
return(0);
}
Related examples in the same category