-
-
Save parzibyte/f6860a289aa923877cb1481a32662624 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 lectura; // Aquí vamos a ir leyendo cada valor por separado | |
string cadena = "soy;una cadena;separada por punto y coma"; // La cadena que vamos a separar | |
stringstream input_stringstream(cadena); // Convertir la cadena a un stream | |
while (getline(input_stringstream, lectura, ';')) | |
{ | |
cout << "Un valor: " << lectura << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment