#include <iostream>
#include <string>
using namespace std;
class Person{
public:
Person(string n, int a, string g) {
setName(n);
setAge(a);
setGender(g);
}
void setName(string x) {
name = x;
}
void setAge(int x) {
age = x;
}
void setGender(string x) {
gender = x;
}
get() {
return "\nName: " + name + "\nAge: " + age + "\nGender: " + gender + "\n";
}
private:
string name;
int age;
string gender;
};
int main() {
return 0;
}
That is my code, all I wanted to do was make a basic class with a constructer, with three parametres that defines the name, age and gender, for some reason, when I try and run this to check that everything is working fine, I get an error stating (line 23) : mismatched types 'const __gnu_cxx::__normal_iterator.
Can someone please help by fixing my code? I really don't understand what I've done wrong, thanks in advance!