-
-
Save parzibyte/38ccf705f38b0864f952ccbad0488170 to your computer and use it in GitHub Desktop.
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
/* | |
https://parzibyte.me/blog | |
*/ | |
#include <iostream> | |
#include <sstream> | |
using namespace std; | |
int main() | |
{ | |
string cadena = "Luis Cabrera luis@ejemplo.com parzibyte.me"; // Nombre Apellido correo página web | |
stringstream input_stringstream(cadena); // Convertir la cadena a un stream | |
string nombre, apellido, correo, paginaWeb; | |
// Extraer | |
char delimitador =' '; | |
getline(input_stringstream, nombre, delimitador); | |
getline(input_stringstream, apellido, delimitador); | |
getline(input_stringstream, correo, delimitador); | |
getline(input_stringstream, paginaWeb, delimitador); | |
// Imprimir | |
cout << "Nombre: " << nombre << endl; | |
cout << "Apellido: " << apellido << endl; | |
cout << "Correo: " << correo << endl; | |
cout << "Web: " << paginaWeb << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment