Incompleat type is not allowed

I am trying to get a program to take two files and place them into a third file. I have searched all over this website looking for a solution and i can seem to find one. I am very new to C++ and programing in general so please forgive my ignorance.

My issue is that i keep getting an error 'incomplete type is not allowed' as well as 'no operator matches these ">>" these operands.'

What is wrong?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include<iostream>
#include<string>
#include <sstream>
using namespace std;




int main()
{
	string filename1;
	cout << "please enter first file: ";
	cin>> filename1;
	ifstream f1(filename1.c_str());

	string filename2;
	cout << "please enter second file: ";
	cin>> filename2;
	ifstream f2(filename2.c_str());

	string filename3;
	cout << "please enter thrid file name: ";
	cin>> filename3;
	ifstream f3(filename3.c_str());

	char ch;
	while(f1>>ch);
		f3<<ch;
	while(f2>>ch);
		f3<<ch;

	f3.close();
	f3.open();

	while(f3>>ch)
		cout<< ch;


	system ("pause");	
	return 0;
}


Thank you very much for you time. This has been killing me.
> My issue is that i keep getting an error 'incomplete type is not allowed'
> as well as 'no operator matches these ">>" these operands.'
http://www.cplusplus.com/forum/articles/40071/#msg216270
Last edited on
Topic archived. No new replies allowed.