-
-
Save parzibyte/647a1c1d03590c12fd3b3ad819344593 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
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
/* | |
https://parzibyte.me/blog | |
*/ | |
int main() { | |
string nombreArchivo = "videojuegos.txt"; | |
ofstream archivo; | |
// Abrimos el archivo | |
archivo.open(nombreArchivo.c_str(), fstream::out); | |
// Y le escribimos redirigiendo | |
archivo << "cuph"; | |
archivo << "ead"; | |
// No olvidemos saltos de línea | |
archivo << endl; | |
// Podemos escribir más | |
archivo << "doom eternal" << endl; | |
archivo << "doom 2016" << endl; | |
archivo << "resident evil 2" << endl; | |
// Finalmente lo cerramos | |
archivo.close(); | |
cout << "Escrito correctamente"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment