READING FROM TWO FILES SIMULTANEOUSLY
< iostream>
<fstream>
<stdlib.h>
main()
{
SIZE=80;
line[SIZE];
std::ifstream fin1,fin2;
fin1.open("country");
fin2.open("capital");
( i=1;i<=10;i++)
{
(fin1.eof()!=0)
{
std::cout << "Exit from country \n";
(1);
}
fin1.getline(line,SIZE);
std::cout << "capital of " << line;
(fin2.eof()!=0)
{
std::cout << "Exit from capital \n";
(1);
}
fin2.getline(line,SIZE);
std::cout << line << "\n";
}
}
|