[Error] expected primary-expression before ....

Need help [Error] expected primary-expression before 'manufacturer','type',......

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
#include <iostream>
#include <string>
#include "Car.h"

using namespace std;
int main (){
	Car carinformation[80];
	string pause="pause";
	cout<<"HI,Welcome Users!";
	cout<<"We are now here to help you!";
	cout<<"Please key in your car's information to store in it but maximum is only 80cars!";
	cout<<"All you need to key in is:\n"<<"Car's Manufacturer\n"<<"Car's Type\n"<<"Car's Seatnumber\n"
		<<"Car's Plate Number\n"<<"Car's Model\n";

		for (int i=1;i<=2;i++){
		carinformation[i].setmanufacturer(string manufacturer);
	}
		for (int i1=1;i1<=2;i1++){
		carinformation[i1].settype(string type);
	}
		for (int i2=1;i2<=2;i2++){
		carinformation[i2].setseatnumber(int seatnumber);
	}
		for (int i3=1;i3<=2;i3++){
		carinformation[i3].setCarplatenumber(string carplatenumber);
	}
		for (int i4=1;i4<=2;i4++){
		carinformation[i4].setModel(string model);
	}

	
	for(int j=1;j<=2;j++){
		carinformation[j].getmanufacturer();
	}
	for(int j1=1;j1<=2;j1++){
		carinformation[j1].gettype();
	}
	for(int j2=1;j2<=2;j2++){
		carinformation[j2].getseatnumber();
	}
	for(int j3=1;j3<=2;j3++){
		carinformation[j3].getcarplatenumber();
	}
	for(int j4=1;j4<=2;j4++){
		carinformation[j4].getmodel();
	}
	
	
	return 0;
}
When you call a function you should replace the parameter type and name with the value/variable that you want to pass to the function.

1
2
carinformation[i].setmanufacturer(string manufacturer);
carinformation[i].setmanufacturer("Volvo");

actually i want the user to input it so i need to change to cin ??
Create a variable. Use cin to read a value from the user and store it in the variable. Pass the variable to the function.
Topic archived. No new replies allowed.