-
-
Save parzibyte/b772fcbb702888ee8226b1612974b8c3 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
void cambiar_configuracion(string nick, ConfiguracionTablero configuracion) | |
{ | |
ofstream archivo; | |
archivo.open(nombre_archivo_configuracion(nick).c_str(), fstream::out); | |
archivo << configuracion.columnas; | |
archivo << endl; | |
archivo << configuracion.filas; | |
archivo.close(); | |
} | |
ConfiguracionTablero obtener_configuracion_tablero(string nick) | |
{ | |
ConfiguracionTablero configuracion; | |
ifstream archivo(nombre_archivo_configuracion(nick).c_str()); | |
// Leemos la línea dentro de "linea" y convertimos | |
string linea; | |
getline(archivo, linea); | |
configuracion.columnas = atoi(linea.c_str()); | |
// Lo mismo pero para la segunda línea, misma que representa las columnas | |
getline(archivo, linea); | |
configuracion.filas = atoi(linea.c_str()); | |
return configuracion; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment