Strcpy copies a string from one array into another. - C++ Data Type

C++ examples for Data Type:char array

Description

Strcpy copies a string from one array into another.

Demo Code

#include <iostream> 
  
using namespace std; 
  
int main(int argc, char *argv [])
{ 
        char* cStyleString1 = "CStyleString"; 
        char cStyleString2[13]; 
        strcpy(cStyleString2, cStyleString1); 
  
        cout << cStyleString2 << endl; 
  
        return 0; 
}

Result


Related Tutorials