The program consists of writing a number (in this case 1) in a file and then opening the file and displaying it on the screen. The problem is that I do not know how to pick up an int.
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
int c;
ofstream ficheroSalida;
ficheroSalida.open("almacen.txt");
ficheroSalida << 1 ;
ficheroSalida.close();
fstream ficheroEntrada;
ficheroEntrada.open("almacen.txt");
if(ficheroEntrada.is_open())
{
while(!ficheroEntrada.eof())
{
ficheroEntrada.get(c);
}
cout << c;
}
return 0;
}