Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
46.- C++ desde cero 2019🦸‍♂️ [Ejercicio 32.- Concatenar strings con s…
…trcat] Video: https://youtu.be/1Ag14bFDOiQ
- Loading branch information
1 parent
e7d89fd
commit 3a23c1a
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
Declarar 3 variables de tipo string. | ||
Pedir al humano que ingrese nombre y apellido y guardarlos en el string 1 y 2. | ||
Colocar los valores del string 1 y 2 en el string 3. | ||
*/ | ||
#include <iostream> | ||
#include <string.h> | ||
|
||
int main(){ | ||
char nombre[20],apellido[20],nombreApellido[40]={}; | ||
std::cout<<"Humano ingresa tu nombre: "; | ||
std::cin>>nombre; | ||
std::cout<<"Humano ingresa tu apellido: "; | ||
std::cin>>apellido; | ||
strcat(nombreApellido,nombre); | ||
strcat(nombreApellido," "); | ||
strcat(nombreApellido,apellido); | ||
std::cout<<"Humano este es tu pinche nombre y apellido: "<<nombreApellido<<"\n"; | ||
system("pause"); | ||
return 0; | ||
} |
Binary file not shown.