Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 11, 2020 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/7f77345fea4e45f711c8e0a7cd339ffc to your computer and use it in GitHub Desktop.
Save parzibyte/7f77345fea4e45f711c8e0a7cd339ffc to your computer and use it in GitHub Desktop.
#include <iostream>
#include <fstream>
using namespace std;
/*
https://parzibyte.me/blog
*/
int main() {
string nombreArchivo = "videojuegos.txt";
ifstream archivo(nombreArchivo.c_str());
string linea;
// Obtener línea de archivo, y almacenar contenido en "linea"
while (getline(archivo, linea)) {
// Lo vamos imprimiendo
cout << "Una línea: ";
cout << linea << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment