Mega Code Archive

 
Categories / C / Pointer
 

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); }