“Concatenate String en CPP” Código de respuesta

C de la Cadena C Ejemplo de concatenación

#include <iostream>  
#include <cstring>  
using namespace std;  
int main()  
{  
    char key[25], buffer[25];  
    cout << "Enter the key string: ";  
    cin.getline(key, 25);  
    cout << "Enter the buffer string: ";  
     cin.getline(buffer, 25);  
    strcat(key, buffer);   
    cout << "Concatenation = " << key << endl;  
    return 0;  
}
Outrageous Ostrich

cómo concatinar dos cuerdas en c

#include <iostream>
#include <cstdlib>

std::string text = "hello";
std::string moretext = "there";
std::string together = text + moretext;
std::cout << together << std::endl;

>> hello there
Angry Alpaca

Concatenate String en CPP

string firstName = "John";
string lastName = "Doe";
string fullName = firstName + " " + lastName;
cout << fullName; 
Merwanski

Respuestas similares a “Concatenate String en CPP”

Preguntas similares a “Concatenate String en CPP”

Más respuestas relacionadas con “Concatenate String en CPP” en C++

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código