Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created April 15, 2021 13:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/f6860a289aa923877cb1481a32662624 to your computer and use it in GitHub Desktop.
Save parzibyte/f6860a289aa923877cb1481a32662624 to your computer and use it in GitHub Desktop.
/*
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