Yes there is i guess.u can use fstream.h.It actually makes a file and stores the value of ur required integer in it.And you can access it when ever u need it.
1 2 3 4 5 6 7 8 9 10 11 12
#include<iostream>
#include<fstream>
int main(){
int x;
ofstream fout;
fout.open("aaa.txt",ios::out);
cin>>x;
fout<<x;
fout.close();
return 0;
}
this creates an output stream object fout that stores the value of x into a file named aaa.txt.U can access it whenever u need using a input stream object
nb::if u check the folder in which ur .cpp file was stored there
will be a txt file named aaa which holds the current value of x