Strcat allows us to join, or concatenate, two strings. - C++ Data Type

C++ examples for Data Type:char array

Description

Strcat allows us to join, or concatenate, two strings.

Demo Code

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

Result


Related Tutorials