Untitled
unknown
c_cpp
2 years ago
359 B
6
Indexable
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const string b = "Asd.txt";
void vod(int &a)
{
ofstream c(b);
c << a;
c.close();
}
void foo(int &a)
{
ifstream c(b);
if (!c.is_open())
{
cout << "error";
}
vod(a);
c >> a;
c.close();
}
int main()
{
int a;
cin >> a;
foo(a);
cout << a;
}Editor is loading...
Leave a Comment