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