problem in "expected primary expressions"--- can't identify it. please help

#include<iostream>
#include<string.h>
using namespace std;

class person
{ private:
string lastname;
string firstname;
char gender;
public:
person( string lastname, string firstname, char gender){};
person(){};
void setLastname(string lastname){this->lastname;}
void setFirstname(string firstname){this->firstname;}
void setGender(char gender){this->gender;}
string getLastname(){return lastname;}
string getFirstname(){return firstname;}
char getGender(){return gender;}
void display( string lastname, string firstname, char gender){
cout<<"Name: "<<lastname<<","<<firstname<<"\nGemder:"<<gender;}
};

class student:public person{
private:
int idnumber;
string course;
public:
student(int idnumber, string course)
{
void setPerson(string lastname,string firstname,char gender);
void setStudent(int idnumber,string course);
};

student(){};
void setCourse(string course);
void setidnumber(int idnumber);
string getCourse(){return course;}
int getidnumber(){return idnumber;}

void display(string lastname, string firstname, char gender, int idnumber, string course) {
cout<<"Name: "<<lastname<<","<<firstname<<"\nGemder:"<<gender<<"'nidnumber :"<<idnumber<<"Course :"<<course;}

};

void addStudents(student list[10]){
string lname;
string fname;
char gen;
int id,i;
string course;
for(i=0;i<10;i++){
cout<<"Enter Firstname: ";
cin>>fname;
cout<<"Enter lastname: ";
cin>>lname;
cout<<"Enter gender(m/f): ";
cin>>gen;
cout<<"Enter idnumber: ";
cin>>id;
cout<<"Enter course: ";
cin>>course;}
person(lname,fname,gen);
student(id,course);
}

void displayStudents(student list[10]){
int i;
cout<<student list[i];
}

int main(){
person p;
student s;
addStudents(student list[10]);
displayStudents(student list[10]);
return 0;
}
Hi,

To help us out, always use code tags:

http://www.cplusplus.com/articles/z13hAqkS/


If you have compile errors, post them here, make sure that the lines numbers match your code here.
Topic archived. No new replies allowed.