writing to file streams code example
Example 1: file reading c++
int a, b;
ifstream bd;
myfile.open("file.txt");
if (myfile.is_open())
while (bd >> a >> b)
cout << a << b << endl;
else cout << "ERROR";
Example 2: fstream read write mode
stream file;
file.open(fileName,ios::in | ios::out);