how to read from the file in c++ using fstream code example
Example: 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";
int a, b;
ifstream bd;
myfile.open("file.txt");
if (myfile.is_open())
while (bd >> a >> b)
cout << a << b << endl;
else cout << "ERROR";