class x { private: int a,temp; fstream f; public: x() { a=0; } void incr() { f.open("data.txt",ios::out); f<<a; f.close(); f.open("data.txt",ios::in); f>>a; temp=a+1; f.close(); } }; int main() { x o; o.incr(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)