1.
int main ()
2.
{
3.
.
4.
.
5.
.
6.
.
7.
8.
9.
ifstream file1;
10.
ifstream file2;
11.
ofstream simiralities;
12.
simiralities.open("P(0)_P(1).txt", ios::app);
13.
file1.open("test1.txt", ios::in);
14.
// A good way to check if a file has been opened-
if (! file1)
{
cout << "error opening file" << endl;
return -1;
/*Your program isn't opening your files correctly, and will exit here. Have a gander & see what you can come up with*/
}
15.
while (!file1.eof())
16.
{
17.
.
18.
.
19.
.
20.
21.
22.
file2.open("test2.txt", ios::in);
23.
24.
25.
while (!file2.eof())
26.
{
27.
28.
.
29.
.
30.
.
31.
.
32.
33.
}
34.
35.
file2.close();
36.
37.
38.
}
39.
40.
simiralities<<number;
41.
file1.close();
42.
simiralities.close();
43.
44.
return 0;
45.
}
lexusdominus
Junior Poster in Training
84 posts since Jun 2009
Reputation Points: 12
Solved Threads: 5