Cannot fix this compile error

Below, the line after public, it my compiler is complaining about the commas and I don't know how to fix this.
1
2
3
4
5
6
7
8
9
10
11
class NameRecord{
	private:  //vars are private
		string name;
		int frequency;
		int rank;
	public:  //functs are public
		NameRecord (name, frequency, rank); //constructor, error is here
		string getName(); //returns name
		int getFrequency(); //return the number of babies given this name
		int getRank();  //return the name's rank
};	
Last edited on
for your constructor you are putting the variables name instead of the data type like you should be.

Try it like this

1
2
3
4
5
6
7
8
9
10
11
class NameRecord{
	private:  //vars are private
		string name;
		int frequency;
		int rank;
	public:  //functs are public
		NameRecord (string, int, int); //constructor, error is here
		string getName(); //returns name
		int getFrequency(); //return the number of babies given this name
		int getRank();  //return the name's rank
};	
Topic archived. No new replies allowed.