Need help to wrap my project

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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
void Combine(string x,string y,string z)
{
	int flag=0; string a,b,c,d,e,f,g,h;

	for(int i=0; i<lecturer.size();i++) // Fetch lecturer's faculty
	if(Upper(lecturer[i].getLecName())==Upper(x))
	{
		a = lecturer[i].getLecName();
		b = lecturer[i].getLecId();
		c = lecturer[i].getLecFac();
	}

	for(int i=0; i<student.size();i++) // Fetch student's faculty
	if(Upper(student[i].getStudName())==Upper(y))
	{
		d = student[i].getStudName();
		e = student[i].getStudId();
		f = student[i].getStudFac();
	}

	for(int i=0; i<project.size();i++) // Fetch project's faculty
	if(Upper(project[i].getProjName())==Upper(z))
	{
		g = project[i].getProjName();
		h = project[i].getProjId();
	}

	Record temp(a,b,c,d,e,f,g,h); // Confirm registration
	record.push_back(temp);
}



void Import(char filename[])
{
	vector<string>temp;
	ifstream in; string data;

	in.open(filename);

	while (getline(in,data,'\n')) // Store the data line by line
		temp.push_back(data);

	for (int i=0; i<temp.size(); i++)
	{
		int count=0; string str = temp[i];
		stringstream stream(str);

		while(getline(stream, data, ',')) // Seperate data by comma
		{
			if(count==0)
				temp1 = data;
			else if (count==1)
				temp2 = data;

			count++;
		}

		if(filename=="lecturer.txt")
		{
			Lecturer x(temp1, temp2, temp3);
			lecturer.push_back(x);
			Combine("", temp1);
		}
		else if(filename=="students.txt")
		{
			Student x(temp1, temp2, temp3);
			student.push_back(x);
			Combine(temp1,"");
		}
		else if(filename=="projects.txt")
			Combine(temp1,temp2,temp3);
	}

	temp.clear();
	in.clear();
	in.close();
}

string Upper(string x)
{
	for (int i=0; i<x.size(); i++)
	x[i] = toupper(x[i]);

	return x;
}



Im having problem in line 1 and line 63. In line 1,it says to few arguments to function. and in line 63 it says error in this point of file
Do you have a declaration for Combine in a header file or as a forward declaration?

At line 1, you've implemented Combine with three arguments.
At line 63 and 69, you're calling Combine with two arguments.
At line 72, you call it with three arguments.

In C++, you can have functions with different number of arguments and the compiler will sort you which you intended to call (you must implement both variations).
However in C you can not have conflicting function definitions.




Topic archived. No new replies allowed.