-
-
Save parzibyte/7862c7f0e29ceaa3775025ae97a3a47b 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 | |
getline(input_stringstream, nombre, ';'); | |
getline(input_stringstream, apellido, ';'); | |
getline(input_stringstream, correo, ';'); | |
getline(input_stringstream, paginaWeb, ';'); | |
// 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